jspm 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +37 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2494,19 +2494,23 @@ function getInputPath(flags, fallbackDefaultMap = defaultMapPath) {
|
|
|
2494
2494
|
if (mapPath) {
|
|
2495
2495
|
return resolve(mapPath);
|
|
2496
2496
|
}
|
|
2497
|
-
|
|
2498
|
-
|
|
2497
|
+
const defaultMapPathResolved = resolve(flags.dir ?? ".", defaultMapPath);
|
|
2498
|
+
if (exists(defaultMapPathResolved)) {
|
|
2499
|
+
return defaultMapPathResolved;
|
|
2499
2500
|
}
|
|
2500
|
-
|
|
2501
|
+
const fallbackDefaultMapResolved = resolve(flags.dir ?? ".", fallbackDefaultMap);
|
|
2502
|
+
return fallbackDefaultMapResolved;
|
|
2501
2503
|
}
|
|
2502
2504
|
function getOutputPath(flags) {
|
|
2503
2505
|
if (flags.out || flags.map) {
|
|
2504
2506
|
return resolve(flags.out || flags.map);
|
|
2505
2507
|
}
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
+
const defaultMapPathResolved = resolve(flags.dir ?? ".", defaultMapPath);
|
|
2509
|
+
if (defaultMapPathResolved) {
|
|
2510
|
+
return defaultMapPathResolved;
|
|
2508
2511
|
}
|
|
2509
|
-
|
|
2512
|
+
const fallbackDefaultMapResolved = resolve(flags.dir ?? ".", defaultMapPath);
|
|
2513
|
+
return fallbackDefaultMapResolved;
|
|
2510
2514
|
}
|
|
2511
2515
|
function getOutputMapUrl(flags) {
|
|
2512
2516
|
return pathToFileURL(getOutputPath(flags));
|
|
@@ -29205,7 +29209,7 @@ async function build(flags) {
|
|
|
29205
29209
|
format: "esm",
|
|
29206
29210
|
assetFileNames: "[name][extname]",
|
|
29207
29211
|
entryFileNames: "[name]",
|
|
29208
|
-
chunkFileNames: "[name]",
|
|
29212
|
+
chunkFileNames: "lib/[name]-[hash:8].js",
|
|
29209
29213
|
sourcemap: true,
|
|
29210
29214
|
compact: flags.minify
|
|
29211
29215
|
});
|
|
@@ -29219,7 +29223,18 @@ async function build(flags) {
|
|
|
29219
29223
|
await writeFile3(`${outPath}.map`, JSON.stringify(chunk.map));
|
|
29220
29224
|
}
|
|
29221
29225
|
}
|
|
29222
|
-
const
|
|
29226
|
+
const projectBase = `${pathToFileURL4(projectConfig.projectPath).href}/`;
|
|
29227
|
+
const generatedFiles = /* @__PURE__ */ new Set();
|
|
29228
|
+
for (const chunk of output) {
|
|
29229
|
+
generatedFiles.add(chunk.fileName);
|
|
29230
|
+
if (chunk.type === "chunk") {
|
|
29231
|
+
for (const refFile of chunk.moduleIds) {
|
|
29232
|
+
if (refFile.startsWith(projectBase)) {
|
|
29233
|
+
generatedFiles.add(relative3(projectBase, refFile).replace(/\\/g, "/"));
|
|
29234
|
+
}
|
|
29235
|
+
}
|
|
29236
|
+
}
|
|
29237
|
+
}
|
|
29223
29238
|
{
|
|
29224
29239
|
const pjson = JSON.parse(
|
|
29225
29240
|
readFileSync2(join3(projectConfig.projectPath, "package.json"), "utf8")
|
|
@@ -29245,7 +29260,9 @@ async function build(flags) {
|
|
|
29245
29260
|
}
|
|
29246
29261
|
stopSpinner();
|
|
29247
29262
|
if (!flags.quiet) {
|
|
29248
|
-
console.log(`${c11.green("\u2713")} Built ${c11.cyan(projectConfig.name)} to ${c11.cyan(flags.out)}
|
|
29263
|
+
console.log(`${c11.green("\u2713")} Built ${c11.cyan(projectConfig.name)} to ${c11.cyan(flags.out)}.
|
|
29264
|
+
|
|
29265
|
+
${c11.cyan("Info:")} Run ${c11.bold("jspm -d dist install -C production -fs")} to create a production build map.`);
|
|
29249
29266
|
}
|
|
29250
29267
|
} catch (e) {
|
|
29251
29268
|
stopSpinner();
|
|
@@ -33054,8 +33071,19 @@ Uses RollupJS under the hood to create optimized bundles.
|
|
|
33054
33071
|
|
|
33055
33072
|
The package entry points as defined in the package.json "exports" field are built, with the
|
|
33056
33073
|
entire package copied into the output directory. As such, it is a whole-package transformation.
|
|
33074
|
+
|
|
33075
|
+
Build externals are taken from the package.json "dependencies" to form a roughly configurationless
|
|
33076
|
+
build workflow (dependencies in "devDependencies" or otherwise are inlined into the build).
|
|
33077
|
+
|
|
33057
33078
|
Includes and ignores can be specified using the package.json "files" and "ignore" fields,
|
|
33058
33079
|
optionally using the JSPM overrides for these via the "jspm" property in the package.json.
|
|
33080
|
+
|
|
33081
|
+
Any build import map shoud be generated separately via a subsequent install operation on the
|
|
33082
|
+
build folder, for example like:
|
|
33083
|
+
|
|
33084
|
+
${c17.bold("jspm install -d dist -C production --flatten-scopes --combine-subpaths")}
|
|
33085
|
+
|
|
33086
|
+
to generate an optimized production map.
|
|
33059
33087
|
`
|
|
33060
33088
|
).action(wrapCommand(build));
|
|
33061
33089
|
outputOpts(
|