@nebula.js/cli-build 5.0.0-alpha.2 → 5.0.0-alpha4
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 +16 -12
- package/lib/config.js +23 -11
- package/lib/init-config.js +6 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -16,18 +16,22 @@ nebula build
|
|
|
16
16
|
Build nebula.js visualization
|
|
17
17
|
|
|
18
18
|
Options:
|
|
19
|
-
--version
|
|
20
|
-
--config, -c
|
|
21
|
-
|
|
22
|
-
--watch, -w
|
|
23
|
-
|
|
24
|
-
--sourcemap, -m
|
|
25
|
-
--mode
|
|
26
|
-
|
|
27
|
-
--core
|
|
28
|
-
--typescript
|
|
29
|
-
--preferBuiltins
|
|
30
|
-
|
|
19
|
+
--version Show version number [boolean]
|
|
20
|
+
--config, -c Path to a JavaScript config file
|
|
21
|
+
[string] [default: "nebula.config.js"]
|
|
22
|
+
--watch, -w Watch source files
|
|
23
|
+
[choices: "umd", "systemjs"] [default: "umd"]
|
|
24
|
+
--sourcemap, -m Generate source map [boolean] [default: true]
|
|
25
|
+
--mode Explicitly set mode
|
|
26
|
+
[string] [choices: "production", "development"]
|
|
27
|
+
--core Set a core build target [string] [default: "core"]
|
|
28
|
+
--typescript Enable typescript bundling [boolean] [default: false]
|
|
29
|
+
--preferBuiltins Specify whether to use Node.js built-in modules.
|
|
30
|
+
[boolean] [default: true]
|
|
31
|
+
--browser Use the browser module resolutions in package.json and adds
|
|
32
|
+
'browser' to exportConditions if it is not present so browser
|
|
33
|
+
conditionals in exports are applied.
|
|
34
|
+
[boolean] [default: false]
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
## Example
|
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 },
|
|
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,16 +193,7 @@ const config = ({
|
|
|
172
193
|
],
|
|
173
194
|
].filter(Boolean),
|
|
174
195
|
},
|
|
175
|
-
output:
|
|
176
|
-
banner,
|
|
177
|
-
format,
|
|
178
|
-
file: path.resolve(dir, outputFile),
|
|
179
|
-
name: outputName,
|
|
180
|
-
sourcemap,
|
|
181
|
-
globals: {
|
|
182
|
-
'@nebula.js/stardust': 'stardust',
|
|
183
|
-
},
|
|
184
|
-
},
|
|
196
|
+
output: output(),
|
|
185
197
|
};
|
|
186
198
|
};
|
|
187
199
|
|
package/lib/init-config.js
CHANGED
|
@@ -54,6 +54,12 @@ const options = {
|
|
|
54
54
|
type: 'boolean',
|
|
55
55
|
default: false,
|
|
56
56
|
},
|
|
57
|
+
codeSplit: {
|
|
58
|
+
description:
|
|
59
|
+
'Sets output.dir instead of output.file for code-splitting builds. Sets inlineDynamicImports for umd builds to avoid throwing errors.',
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
// nebula build --watch - watch umd bundle
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/cli-build",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-alpha4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "QlikTech International AB",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"lint": "eslint src"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/cli": "7.23.
|
|
25
|
-
"@babel/core": "7.23.
|
|
24
|
+
"@babel/cli": "7.23.9",
|
|
25
|
+
"@babel/core": "7.23.9",
|
|
26
26
|
"@babel/plugin-transform-react-jsx": "7.23.4",
|
|
27
|
-
"@babel/preset-env": "7.23.
|
|
27
|
+
"@babel/preset-env": "7.23.9",
|
|
28
28
|
"@rollup/plugin-babel": "6.0.4",
|
|
29
29
|
"@rollup/plugin-commonjs": "25.0.7",
|
|
30
30
|
"@rollup/plugin-json": "6.1.0",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"@rollup/plugin-terser": "0.4.4",
|
|
34
34
|
"chalk": "4.1.2",
|
|
35
35
|
"extend": "3.0.2",
|
|
36
|
-
"postcss": "^8.4.
|
|
37
|
-
"rollup": "4.
|
|
36
|
+
"postcss": "^8.4.35",
|
|
37
|
+
"rollup": "4.12.0",
|
|
38
38
|
"rollup-plugin-postcss": "4.0.2",
|
|
39
39
|
"rollup-plugin-sourcemaps": "0.6.3",
|
|
40
40
|
"yargs": "17.7.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@rollup/plugin-typescript": "11.1.
|
|
43
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
44
44
|
"tslib": "*",
|
|
45
45
|
"typescript": ">=5.3.3"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d8b137df822275d3a59d23828e77b16f172dd908"
|
|
48
48
|
}
|