Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: do not use platform: "node" defaults #77

Merged
merged 2 commits into from
Oct 31, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "fs/promises";
import { builtinModules } from "module";
import path from "path";
import esbuild from "esbuild";
import { getPackage, pkgsDir, pkgsList, projectRoot } from "./common.mjs";
Expand Down Expand Up @@ -30,6 +31,8 @@ async function walk(rootPath) {
*/
function getPackageDependencies(pkg, includeDev) {
return [
"node:",
...builtinModules,
lukeed marked this conversation as resolved.
Show resolved Hide resolved
...(pkg.dependencies ? Object.keys(pkg.dependencies) : []),
...(includeDev && pkg.devDependencies
? Object.keys(pkg.devDependencies)
Expand All @@ -46,11 +49,13 @@ function getPackageDependencies(pkg, includeDev) {
const buildOptions = {
format: "esm",
// outExtension: { ".js": ".mjs" },
platform: "node",
platform: "neutral",
target: "esnext",
bundle: true,
sourcemap: true,
sourcesContent: false,
mainFields: ["module", "main"],
conditions: ["import", "node", "production", "default"],
// minify: true,
// minifySyntax: true,
// minifyWhitespace: true,
Expand Down