@nebula.js/cli-build 4.10.0 → 4.11.0

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/README.md CHANGED
@@ -30,10 +30,7 @@ Options:
30
30
  [boolean] [default: true]
31
31
  --browser Use the browser module resolutions in package.json and adds
32
32
  'browser' to exportConditions if it is not present so browser
33
- conditionals in exports are applied.
34
- [boolean] [default: false]
35
- --inlineDynamicImports Inlines dynamic imports, allowing for code-splitting
36
- regardless of format.
33
+ conditionals in exports are applied.
37
34
  [boolean] [default: false]
38
35
  ```
39
36
 
package/lib/config.js CHANGED
@@ -61,7 +61,7 @@ const config = ({
61
61
  mode = 'production',
62
62
  format = 'umd',
63
63
  cwd = process.cwd(),
64
- argv = { sourcemap: true, inlineDynamicImports: false },
64
+ argv = { sourcemap: true, codeSplit: false },
65
65
  core,
66
66
  behaviours: {
67
67
  getExternal = getExternalDefault,
@@ -113,6 +113,27 @@ const config = ({
113
113
  external.push('@nebula.js/stardust');
114
114
  }
115
115
 
116
+ const output = () => {
117
+ const outputConfig = {
118
+ banner,
119
+ format,
120
+ name: outputName,
121
+ sourcemap,
122
+ globals: {
123
+ '@nebula.js/stardust': 'stardust',
124
+ },
125
+ };
126
+ if (!argv.codeSplit || format === 'umd') {
127
+ outputConfig.file = path.resolve(dir, outputFile);
128
+ } else {
129
+ outputConfig.dir = path.resolve(dir, outputFile.split('/')[0]);
130
+ }
131
+ if (argv.codeSplit && format === 'umd') {
132
+ outputConfig.inlineDynamicImports = true;
133
+ }
134
+ return outputConfig;
135
+ };
136
+
116
137
  return {
117
138
  input: {
118
139
  onwarn(warning, warn) {
@@ -172,17 +193,7 @@ const config = ({
172
193
  ],
173
194
  ].filter(Boolean),
174
195
  },
175
- output: {
176
- banner,
177
- format,
178
- inlineDynamicImports: argv.inlineDynamicImports,
179
- file: path.resolve(dir, outputFile),
180
- name: outputName,
181
- sourcemap,
182
- globals: {
183
- '@nebula.js/stardust': 'stardust',
184
- },
185
- },
196
+ output: output(),
186
197
  };
187
198
  };
188
199
 
@@ -54,9 +54,9 @@ const options = {
54
54
  type: 'boolean',
55
55
  default: false,
56
56
  },
57
- inlineDynamicImports: {
57
+ codeSplit: {
58
58
  description:
59
- 'In Rollup, inlineDynamicImports option is a configuration option that allows code-splitting while still creating a single bundle.',
59
+ 'Sets output.dir instead of output.file for code-splitting builds. Sets inlineDynamicImports for umd builds to avoid throwing errors.',
60
60
  type: 'boolean',
61
61
  default: false,
62
62
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebula.js/cli-build",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "QlikTech International AB",
@@ -33,8 +33,8 @@
33
33
  "@rollup/plugin-terser": "0.4.4",
34
34
  "chalk": "4.1.2",
35
35
  "extend": "3.0.2",
36
- "postcss": "^8.4.33",
37
- "rollup": "4.9.6",
36
+ "postcss": "^8.4.35",
37
+ "rollup": "4.10.0",
38
38
  "rollup-plugin-postcss": "4.0.2",
39
39
  "rollup-plugin-sourcemaps": "0.6.3",
40
40
  "yargs": "17.7.2"
@@ -44,5 +44,5 @@
44
44
  "tslib": "*",
45
45
  "typescript": ">=5.3.3"
46
46
  },
47
- "gitHead": "1be7d26b3c063c05c6d3e85c1ad2b097177dccb3"
47
+ "gitHead": "f22c818690d2752b49033ac811052146a820e742"
48
48
  }