@jsenv/core 28.4.0 → 28.4.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.
@@ -277,6 +277,7 @@ window.__supervisor__ = (() => {
277
277
 
278
278
  const getErrorStackWithoutErrorMessage = error => {
279
279
  let stack = error.stack;
280
+ if (!stack) return "";
280
281
  const messageInStack = `${error.name}: ${error.message}`;
281
282
 
282
283
  if (stack.startsWith(messageInStack)) {
package/dist/main.js CHANGED
@@ -10556,7 +10556,8 @@ const bundleJsModules = async ({
10556
10556
  const {
10557
10557
  babelHelpersChunk = true,
10558
10558
  include,
10559
- preserveDynamicImport = false
10559
+ preserveDynamicImport = false,
10560
+ strictExports = false
10560
10561
  } = options;
10561
10562
  const {
10562
10563
  jsModuleBundleUrlInfos
@@ -10571,7 +10572,8 @@ const bundleJsModules = async ({
10571
10572
  sourcemaps,
10572
10573
  include,
10573
10574
  babelHelpersChunk,
10574
- preserveDynamicImport
10575
+ preserveDynamicImport,
10576
+ strictExports
10575
10577
  });
10576
10578
  return jsModuleBundleUrlInfos;
10577
10579
  };
@@ -10586,6 +10588,7 @@ const rollupPluginJsenv = ({
10586
10588
  include,
10587
10589
  babelHelpersChunk,
10588
10590
  preserveDynamicImport,
10591
+ strictExports,
10589
10592
  resultRef
10590
10593
  }) => {
10591
10594
  let _rollupEmitFile = () => {
@@ -10636,8 +10639,8 @@ const rollupPluginJsenv = ({
10636
10639
 
10637
10640
  emitChunk({
10638
10641
  id,
10639
- implicitlyLoadedAfterOneOf: previousNonEntryPointModuleId ? [previousNonEntryPointModuleId] : null // preserveSignature: "allow-extension",
10640
-
10642
+ implicitlyLoadedAfterOneOf: previousNonEntryPointModuleId ? [previousNonEntryPointModuleId] : null,
10643
+ preserveSignature: strictExports ? "strict" : jsModuleUrlInfo.dependents.size < 2 ? "allow-extension" : "strict"
10641
10644
  });
10642
10645
  previousNonEntryPointModuleId = id;
10643
10646
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "28.4.0",
3
+ "version": "28.4.3",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -66,7 +66,7 @@
66
66
  "@c88/v8-coverage": "0.1.1",
67
67
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
68
68
  "@jsenv/abort": "4.2.4",
69
- "@jsenv/ast": "1.2.2",
69
+ "@jsenv/ast": "1.3.0",
70
70
  "@jsenv/babel-plugins": "1.0.7",
71
71
  "@jsenv/filesystem": "4.1.3",
72
72
  "@jsenv/importmap": "1.2.1",
@@ -39,6 +39,7 @@ export const bundleJsModules = async ({
39
39
  babelHelpersChunk = true,
40
40
  include,
41
41
  preserveDynamicImport = false,
42
+ strictExports = false,
42
43
  } = options
43
44
  const { jsModuleBundleUrlInfos } = await buildWithRollup({
44
45
  signal,
@@ -54,6 +55,7 @@ export const bundleJsModules = async ({
54
55
  include,
55
56
  babelHelpersChunk,
56
57
  preserveDynamicImport,
58
+ strictExports,
57
59
  })
58
60
  return jsModuleBundleUrlInfos
59
61
  }
@@ -69,6 +71,7 @@ const rollupPluginJsenv = ({
69
71
  include,
70
72
  babelHelpersChunk,
71
73
  preserveDynamicImport,
74
+ strictExports,
72
75
 
73
76
  resultRef,
74
77
  }) => {
@@ -116,7 +119,11 @@ const rollupPluginJsenv = ({
116
119
  implicitlyLoadedAfterOneOf: previousNonEntryPointModuleId
117
120
  ? [previousNonEntryPointModuleId]
118
121
  : null,
119
- // preserveSignature: "allow-extension",
122
+ preserveSignature: strictExports
123
+ ? "strict"
124
+ : jsModuleUrlInfo.dependents.size < 2
125
+ ? "allow-extension"
126
+ : "strict",
120
127
  })
121
128
  previousNonEntryPointModuleId = id
122
129
  })
@@ -237,6 +237,7 @@ window.__supervisor__ = (() => {
237
237
 
238
238
  const getErrorStackWithoutErrorMessage = (error) => {
239
239
  let stack = error.stack
240
+ if (!stack) return ""
240
241
  const messageInStack = `${error.name}: ${error.message}`
241
242
  if (stack.startsWith(messageInStack)) {
242
243
  stack = stack.slice(messageInStack.length)