@unpackjs/core 2.3.1 → 2.3.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/compiled/css-loader/index.js +20 -20
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +10 -10
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/webpack-bundle-analyzer/index.js +21 -13274
- package/dist/bundler-config/cache.cjs +2 -1
- package/dist/bundler-config/cache.js +2 -1
- package/dist/bundler-config/css.cjs +10 -5
- package/dist/bundler-config/css.d.ts.map +1 -1
- package/dist/bundler-config/css.js +11 -6
- package/dist/bundler-config/experimentCss.cjs +8 -5
- package/dist/bundler-config/experimentCss.d.ts.map +1 -1
- package/dist/bundler-config/experimentCss.js +9 -6
- package/dist/bundler-config/helpers.cjs +5 -13
- package/dist/bundler-config/helpers.d.ts +3 -2
- package/dist/bundler-config/helpers.d.ts.map +1 -1
- package/dist/bundler-config/helpers.js +6 -14
- package/dist/bundler-config/index.cjs +25 -25
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +23 -26
- package/dist/bundler-config/jsMinify.cjs +1 -1
- package/dist/bundler-config/jsMinify.js +1 -1
- package/dist/bundler-config/progress/helpers.cjs +1 -1
- package/dist/bundler-config/progress/helpers.js +1 -1
- package/dist/bundler-config/progress/rspack.cjs +1 -1
- package/dist/bundler-config/progress/rspack.d.ts.map +1 -1
- package/dist/bundler-config/progress/rspack.js +1 -1
- package/dist/bundler-config/progress/webpack.cjs +1 -1
- package/dist/bundler-config/progress/webpack.d.ts.map +1 -1
- package/dist/bundler-config/progress/webpack.js +1 -1
- package/dist/colors.d.ts +1 -0
- package/dist/colors.d.ts.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.cjs +7 -3
- package/dist/constants.d.ts +7 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -3
- package/dist/createUnpack.cjs +4 -3
- package/dist/createUnpack.d.ts.map +1 -1
- package/dist/createUnpack.js +5 -4
- package/dist/global.d.ts +1 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/index.js +5 -36
- package/dist/logger.cjs +3 -5
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +3 -5
- package/dist/openBrowser.cjs +46 -61
- package/dist/openBrowser.d.ts.map +1 -1
- package/dist/openBrowser.js +2 -18
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prebundleDeps.cjs +4 -3
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +4 -3
- package/dist/run/dev.cjs +8 -5
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +8 -5
- package/dist/typed-css-modules/loader.cjs +91 -130
- package/dist/typed-css-modules/loader.d.ts +1 -3
- package/dist/typed-css-modules/loader.d.ts.map +1 -1
- package/dist/typed-css-modules/loader.js +2 -41
- package/dist/typed-css-modules/plugin.d.ts +1 -1
- package/dist/typed-css-modules/plugin.d.ts.map +1 -1
- package/dist/typed-css-modules/utils.d.ts +1 -1
- package/dist/typed-css-modules/utils.d.ts.map +1 -1
- package/dist/types/config.d.ts +4 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils.cjs +3 -5
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -5
- package/package.json +9 -15
- package/compiled/line-diff/index.d.ts +0 -1
- package/compiled/line-diff/index.js +0 -160
- package/compiled/line-diff/license +0 -21
- package/compiled/line-diff/package.json +0 -1
- package/compiled/portfinder/index.d.ts +0 -105
- package/compiled/portfinder/index.js +0 -3231
- package/compiled/portfinder/license +0 -22
- package/compiled/portfinder/package.json +0 -1
|
@@ -76,7 +76,8 @@ async function getBuildDependencies(root, userBuildDependencies, envFilePaths) {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
|
|
79
|
-
|
|
79
|
+
var _unpackConfig_build, _unpackConfig_dev;
|
|
80
|
+
if (!(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.cache) || (0, external_utils_cjs_namespaceObject.isDevServer)() && (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.lazyCompilation)) return config;
|
|
80
81
|
const cacheConfig = (0, external_utils_cjs_namespaceObject.isPlainObject)(unpackConfig.build.cache) ? unpackConfig.build.cache : {};
|
|
81
82
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
82
83
|
const buildDependencies = await getBuildDependencies(unpackConfig.root, cacheConfig.buildDependencies || [], envFilePaths);
|
|
@@ -40,7 +40,8 @@ async function getBuildDependencies(root, userBuildDependencies, envFilePaths) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
|
|
43
|
-
|
|
43
|
+
var _unpackConfig_build, _unpackConfig_dev;
|
|
44
|
+
if (!(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.cache) || isDevServer() && (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.lazyCompilation)) return config;
|
|
44
45
|
const cacheConfig = isPlainObject(unpackConfig.build.cache) ? unpackConfig.build.cache : {};
|
|
45
46
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
46
47
|
const buildDependencies = await getBuildDependencies(unpackConfig.root, cacheConfig.buildDependencies || [], envFilePaths);
|
|
@@ -45,7 +45,7 @@ const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
|
45
45
|
const external_helpers_cjs_namespaceObject = require("./helpers.cjs");
|
|
46
46
|
function applyCssConfig({ config, unpackConfig }) {
|
|
47
47
|
var _unpackConfig_css, _unpackConfig_css1, _unpackConfig_build, _unpackConfig_css2, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _unpackConfig_css3, _config_module_rules2, _config_module2;
|
|
48
|
-
const
|
|
48
|
+
const CssExtractPlugin = 'rspack' === unpackConfig.bundler ? core_namespaceObject.rspack.CssExtractRspackPlugin : external_mini_css_extract_plugin_default();
|
|
49
49
|
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
50
50
|
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
51
51
|
if (!(0, external_utils_cjs_namespaceObject.isPlainObject)(modules) && false !== modules) modules = {};
|
|
@@ -64,7 +64,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
64
64
|
(0, external_utils_cjs_namespaceObject.isDevServer)() ? {
|
|
65
65
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('style-loader')
|
|
66
66
|
} : {
|
|
67
|
-
loader:
|
|
67
|
+
loader: CssExtractPlugin.loader,
|
|
68
68
|
options: {
|
|
69
69
|
defaultExport: true
|
|
70
70
|
}
|
|
@@ -90,11 +90,16 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
90
90
|
}
|
|
91
91
|
].filter(Boolean);
|
|
92
92
|
if (!(0, external_utils_cjs_namespaceObject.isDevServer)()) {
|
|
93
|
-
var _unpackConfig_build1;
|
|
94
|
-
config.plugins.push(new
|
|
93
|
+
var _unpackConfig_build1, _unpackConfig_build2;
|
|
94
|
+
config.plugins.push(new CssExtractPlugin({
|
|
95
95
|
filename: (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
96
96
|
type: 'css',
|
|
97
97
|
hash: null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.filenameHash
|
|
98
|
+
}),
|
|
99
|
+
chunkFilename: (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
100
|
+
type: 'css',
|
|
101
|
+
hash: null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.filenameHash,
|
|
102
|
+
async: true
|
|
98
103
|
})
|
|
99
104
|
}));
|
|
100
105
|
}
|
|
@@ -104,7 +109,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
104
109
|
...getCommonRules({
|
|
105
110
|
importLoaders: 1
|
|
106
111
|
}),
|
|
107
|
-
(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
112
|
+
(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && (0, external_utils_cjs_namespaceObject.isProd)() && {
|
|
108
113
|
loader: require.resolve('thread-loader'),
|
|
109
114
|
options: external_constants_cjs_namespaceObject.THREAD_OPTIONS
|
|
110
115
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/bundler-config/css.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/bundler-config/css.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAczE,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,oBAAoB,CAuIvB"}
|
|
@@ -6,12 +6,12 @@ import node_path from "node:path";
|
|
|
6
6
|
import { rspack } from "@rspack/core";
|
|
7
7
|
import mini_css_extract_plugin from "mini-css-extract-plugin";
|
|
8
8
|
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT, DEFAULT_LIGHTNINGCSS_TARGET, EXPORT_LOCALS_CONVENTION, THREAD_OPTIONS } from "../constants.js";
|
|
9
|
-
import { getCompiledPkgPath, getUserDepPath, isDev, isDevServer, isFunction, isPlainObject, isRegExp, mergeConfig } from "../utils.js";
|
|
9
|
+
import { getCompiledPkgPath, getUserDepPath, isDev, isDevServer, isFunction, isPlainObject, isProd, isRegExp, mergeConfig } from "../utils.js";
|
|
10
10
|
import { getOutputFilename } from "./helpers.js";
|
|
11
11
|
var css_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
12
12
|
function applyCssConfig({ config, unpackConfig }) {
|
|
13
13
|
var _unpackConfig_css, _unpackConfig_css1, _unpackConfig_build, _unpackConfig_css2, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _unpackConfig_css3, _config_module_rules2, _config_module2;
|
|
14
|
-
const
|
|
14
|
+
const CssExtractPlugin = 'rspack' === unpackConfig.bundler ? rspack.CssExtractRspackPlugin : mini_css_extract_plugin;
|
|
15
15
|
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
16
16
|
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
17
17
|
if (!isPlainObject(modules) && false !== modules) modules = {};
|
|
@@ -30,7 +30,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
30
30
|
isDevServer() ? {
|
|
31
31
|
loader: getCompiledPkgPath('style-loader')
|
|
32
32
|
} : {
|
|
33
|
-
loader:
|
|
33
|
+
loader: CssExtractPlugin.loader,
|
|
34
34
|
options: {
|
|
35
35
|
defaultExport: true
|
|
36
36
|
}
|
|
@@ -56,11 +56,16 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
56
56
|
}
|
|
57
57
|
].filter(Boolean);
|
|
58
58
|
if (!isDevServer()) {
|
|
59
|
-
var _unpackConfig_build1;
|
|
60
|
-
config.plugins.push(new
|
|
59
|
+
var _unpackConfig_build1, _unpackConfig_build2;
|
|
60
|
+
config.plugins.push(new CssExtractPlugin({
|
|
61
61
|
filename: getOutputFilename({
|
|
62
62
|
type: 'css',
|
|
63
63
|
hash: null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.filenameHash
|
|
64
|
+
}),
|
|
65
|
+
chunkFilename: getOutputFilename({
|
|
66
|
+
type: 'css',
|
|
67
|
+
hash: null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.filenameHash,
|
|
68
|
+
async: true
|
|
64
69
|
})
|
|
65
70
|
}));
|
|
66
71
|
}
|
|
@@ -70,7 +75,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
70
75
|
...getCommonRules({
|
|
71
76
|
importLoaders: 1
|
|
72
77
|
}),
|
|
73
|
-
(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
78
|
+
(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && isProd() && {
|
|
74
79
|
loader: require.resolve('thread-loader'),
|
|
75
80
|
options: THREAD_OPTIONS
|
|
76
81
|
},
|
|
@@ -42,13 +42,16 @@ const plugin_cjs_namespaceObject = require("../typed-css-modules/plugin.cjs");
|
|
|
42
42
|
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
43
43
|
const external_helpers_cjs_namespaceObject = require("./helpers.cjs");
|
|
44
44
|
function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
45
|
-
var _unpackConfig_build, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
46
|
-
|
|
45
|
+
var _unpackConfig_build, _unpackConfig_build1, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
46
|
+
config.output.cssFilename = (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
47
47
|
type: 'css',
|
|
48
48
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
49
49
|
});
|
|
50
|
-
config.output.
|
|
51
|
-
|
|
50
|
+
config.output.cssChunkFilename = (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
51
|
+
type: 'css',
|
|
52
|
+
hash: null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.filenameHash,
|
|
53
|
+
async: true
|
|
54
|
+
});
|
|
52
55
|
(0, external_utils_cjs_namespaceObject.setValueByPath)(config, [
|
|
53
56
|
'experiments',
|
|
54
57
|
'css'
|
|
@@ -90,7 +93,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
90
93
|
};
|
|
91
94
|
const getThreadLoader = ()=>{
|
|
92
95
|
var _unpackConfig_build;
|
|
93
|
-
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
96
|
+
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && (0, external_utils_cjs_namespaceObject.isProd)() && {
|
|
94
97
|
loader: require.resolve('thread-loader'),
|
|
95
98
|
options: external_constants_cjs_namespaceObject.THREAD_OPTIONS
|
|
96
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimentCss.d.ts","sourceRoot":"","sources":["../../src/bundler-config/experimentCss.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"experimentCss.d.ts","sourceRoot":"","sources":["../../src/bundler-config/experimentCss.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAczE,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,oBAAoB,CA0IvB"}
|
|
@@ -5,17 +5,20 @@ import { dirname as __webpack_dirname__ } from "node:path";
|
|
|
5
5
|
import node_path from "node:path";
|
|
6
6
|
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT, DEFAULT_LIGHTNINGCSS_TARGET, EXPORT_LOCALS_CONVENTION, THREAD_OPTIONS } from "../constants.js";
|
|
7
7
|
import { PluginTypedCssModules } from "../typed-css-modules/plugin.js";
|
|
8
|
-
import { getCompiledPkgPath, getUserDepPath, isDev, isFunction, isPlainObject, isRegExp, mergeConfig, setValueByPath } from "../utils.js";
|
|
8
|
+
import { getCompiledPkgPath, getUserDepPath, isDev, isFunction, isPlainObject, isProd, isRegExp, mergeConfig, setValueByPath } from "../utils.js";
|
|
9
9
|
import { getOutputFilename } from "./helpers.js";
|
|
10
10
|
var experimentCss_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
11
11
|
function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
12
|
-
var _unpackConfig_build, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
13
|
-
|
|
12
|
+
var _unpackConfig_build, _unpackConfig_build1, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
13
|
+
config.output.cssFilename = getOutputFilename({
|
|
14
14
|
type: 'css',
|
|
15
15
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
16
16
|
});
|
|
17
|
-
config.output.
|
|
18
|
-
|
|
17
|
+
config.output.cssChunkFilename = getOutputFilename({
|
|
18
|
+
type: 'css',
|
|
19
|
+
hash: null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.filenameHash,
|
|
20
|
+
async: true
|
|
21
|
+
});
|
|
19
22
|
setValueByPath(config, [
|
|
20
23
|
'experiments',
|
|
21
24
|
'css'
|
|
@@ -57,7 +60,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
57
60
|
};
|
|
58
61
|
const getThreadLoader = ()=>{
|
|
59
62
|
var _unpackConfig_build;
|
|
60
|
-
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
63
|
+
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && isProd() && {
|
|
61
64
|
loader: require.resolve('thread-loader'),
|
|
62
65
|
options: THREAD_OPTIONS
|
|
63
66
|
};
|
|
@@ -60,19 +60,11 @@ async function getEntry(root, customEntry) {
|
|
|
60
60
|
}
|
|
61
61
|
return entry;
|
|
62
62
|
}
|
|
63
|
-
const getOutputFilename = ({ type, hash })=>{
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
production: ()=>external_constants_cjs_namespaceObject.PROD_DEFAULT_FILENAME.js
|
|
69
|
-
},
|
|
70
|
-
css: {
|
|
71
|
-
development: ()=>external_constants_cjs_namespaceObject.DEV_DEFAULT_FILENAME.css,
|
|
72
|
-
production: ()=>external_constants_cjs_namespaceObject.PROD_DEFAULT_FILENAME.css
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
return handles[type][mode]();
|
|
63
|
+
const getOutputFilename = ({ type, hash, async })=>{
|
|
64
|
+
const hasHash = (0, external_utils_cjs_namespaceObject.isProd)() && false !== hash;
|
|
65
|
+
const FILENAME = hasHash ? external_constants_cjs_namespaceObject.PROD_DEFAULT_FILENAME : external_constants_cjs_namespaceObject.DEV_DEFAULT_FILENAME;
|
|
66
|
+
if (async) return 'js' === type ? FILENAME.jsAsync : FILENAME.cssAsync;
|
|
67
|
+
return FILENAME[type];
|
|
76
68
|
};
|
|
77
69
|
exports.getEntry = __webpack_exports__.getEntry;
|
|
78
70
|
exports.getOutputFilename = __webpack_exports__.getOutputFilename;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare function getEntry(root: string, customEntry: string): Promise<string>;
|
|
2
2
|
type OutputFilename = {
|
|
3
3
|
type: 'js' | 'css';
|
|
4
|
-
hash
|
|
4
|
+
hash?: boolean;
|
|
5
|
+
async?: boolean;
|
|
5
6
|
};
|
|
6
|
-
export declare const getOutputFilename: ({ type, hash }: OutputFilename) => string;
|
|
7
|
+
export declare const getOutputFilename: ({ type, hash, async }: OutputFilename) => string;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helpers.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helpers.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,uBAAuB,cAAc,KAAG,MASzE,CAAA"}
|
|
@@ -2,7 +2,7 @@ import 'module';
|
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import node_fs from "node:fs";
|
|
4
4
|
import node_path from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { isProd } from "../utils.js";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
7
|
import { DEV_DEFAULT_FILENAME, PROD_DEFAULT_FILENAME } from "../constants.js";
|
|
8
8
|
import { logger } from "../logger.js";
|
|
@@ -22,18 +22,10 @@ async function getEntry(root, customEntry) {
|
|
|
22
22
|
}
|
|
23
23
|
return entry;
|
|
24
24
|
}
|
|
25
|
-
const getOutputFilename = ({ type, hash })=>{
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
production: ()=>PROD_DEFAULT_FILENAME.js
|
|
31
|
-
},
|
|
32
|
-
css: {
|
|
33
|
-
development: ()=>DEV_DEFAULT_FILENAME.css,
|
|
34
|
-
production: ()=>PROD_DEFAULT_FILENAME.css
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return handles[type][mode]();
|
|
25
|
+
const getOutputFilename = ({ type, hash, async })=>{
|
|
26
|
+
const hasHash = isProd() && false !== hash;
|
|
27
|
+
const FILENAME = hasHash ? PROD_DEFAULT_FILENAME : DEV_DEFAULT_FILENAME;
|
|
28
|
+
if (async) return 'js' === type ? FILENAME.jsAsync : FILENAME.cssAsync;
|
|
29
|
+
return FILENAME[type];
|
|
38
30
|
};
|
|
39
31
|
export { getEntry, getOutputFilename };
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
3
|
"../../compiled/webpack-bundle-analyzer/index.js": function(module) {
|
|
4
4
|
module.exports = require("../../compiled/webpack-bundle-analyzer/index.js");
|
|
5
|
-
},
|
|
6
|
-
"copy-webpack-plugin": function(module) {
|
|
7
|
-
module.exports = require("copy-webpack-plugin");
|
|
8
|
-
},
|
|
9
|
-
"ts-checker-rspack-plugin": function(module) {
|
|
10
|
-
module.exports = require("ts-checker-rspack-plugin");
|
|
11
5
|
}
|
|
12
6
|
};
|
|
13
7
|
var __webpack_module_cache__ = {};
|
|
@@ -61,15 +55,18 @@ var __webpack_exports__ = {};
|
|
|
61
55
|
const external_node_path_namespaceObject = require("node:path");
|
|
62
56
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
63
57
|
const core_namespaceObject = require("@rspack/core");
|
|
58
|
+
const external_copy_webpack_plugin_namespaceObject = require("copy-webpack-plugin");
|
|
59
|
+
var external_copy_webpack_plugin_default = /*#__PURE__*/ __webpack_require__.n(external_copy_webpack_plugin_namespaceObject);
|
|
64
60
|
const external_html_webpack_plugin_namespaceObject = require("html-webpack-plugin");
|
|
65
61
|
var external_html_webpack_plugin_default = /*#__PURE__*/ __webpack_require__.n(external_html_webpack_plugin_namespaceObject);
|
|
66
|
-
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
67
62
|
const external_json5_namespaceObject = require("json5");
|
|
68
63
|
var external_json5_default = /*#__PURE__*/ __webpack_require__.n(external_json5_namespaceObject);
|
|
69
64
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
70
65
|
const minimizer_cjs_namespaceObject = require("../lightningcss/minimizer.cjs");
|
|
71
66
|
const external_loadEnv_cjs_namespaceObject = require("../loadEnv.cjs");
|
|
72
67
|
const external_plugin_cjs_namespaceObject = require("../plugin.cjs");
|
|
68
|
+
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
69
|
+
const external_ts_checker_rspack_plugin_namespaceObject = require("ts-checker-rspack-plugin");
|
|
73
70
|
const external_webpack_namespaceObject = require("webpack");
|
|
74
71
|
var external_webpack_default = /*#__PURE__*/ __webpack_require__.n(external_webpack_namespaceObject);
|
|
75
72
|
const external_cache_cjs_namespaceObject = require("./cache.cjs");
|
|
@@ -81,20 +78,14 @@ var __webpack_exports__ = {};
|
|
|
81
78
|
const plugin_cjs_namespaceObject = require("./oxlint/plugin.cjs");
|
|
82
79
|
const rspack_cjs_namespaceObject = require("./progress/rspack.cjs");
|
|
83
80
|
const webpack_cjs_namespaceObject = require("./progress/webpack.cjs");
|
|
84
|
-
const { TsCheckerRspackPlugin } = __webpack_require__("ts-checker-rspack-plugin");
|
|
85
81
|
const BundleAnalyzerPlugin = __webpack_require__("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
86
|
-
const CopyWebpackPlugin = __webpack_require__("copy-webpack-plugin");
|
|
87
82
|
async function getBundlerConfig(unpackConfig) {
|
|
88
|
-
var _unpackConfig_build, _unpackConfig_build1,
|
|
83
|
+
var _unpackConfig_build, _unpackConfig_build1, _minifyOptions_oxc, _unpackConfig_build2, _unpackConfig_build3, _unpackConfig_build4, _unpackConfig_build5, _unpackConfig_build6, _unpackConfig_html, _unpackConfig_html1, _unpackConfig_html2, _unpackConfig_html3, _unpackConfig_html4, _unpackConfig_html5, _unpackConfig_html6, _unpackConfig_html7, _unpackConfig_html8, _unpackConfig_performance, _unpackConfig_performance1, _unpackConfig_build7, _unpackConfig_resolve, _unpackConfig_resolve1, _unpackConfig_dev, _unpackConfig_build8, _unpackConfig_experiments;
|
|
89
84
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
90
85
|
const HtmlPlugin = isRspack ? core_namespaceObject.rspack.HtmlRspackPlugin : external_html_webpack_plugin_default();
|
|
91
86
|
const definePlugin = (define)=>isRspack ? new core_namespaceObject.rspack.DefinePlugin(define) : new (external_webpack_default()).DefinePlugin(define);
|
|
92
|
-
const JS_FILENAME = (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
93
|
-
type: 'js',
|
|
94
|
-
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
95
|
-
});
|
|
96
87
|
const IgnorePlugin = isRspack ? core_namespaceObject.rspack.IgnorePlugin : external_webpack_default().IgnorePlugin;
|
|
97
|
-
const CopyPlugin = isRspack ? core_namespaceObject.rspack.CopyRspackPlugin :
|
|
88
|
+
const CopyPlugin = isRspack ? core_namespaceObject.rspack.CopyRspackPlugin : external_copy_webpack_plugin_default();
|
|
98
89
|
const tsconfigPath = external_node_path_default().resolve(unpackConfig.root, 'tsconfig.json');
|
|
99
90
|
const isTs = external_node_fs_default().existsSync(tsconfigPath);
|
|
100
91
|
const getAliasFromTsconfig = ()=>{
|
|
@@ -105,7 +96,7 @@ var __webpack_exports__ = {};
|
|
|
105
96
|
return acc;
|
|
106
97
|
}, {}) : {};
|
|
107
98
|
};
|
|
108
|
-
const minifyOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (
|
|
99
|
+
const minifyOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.minify) ? null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.minify : {};
|
|
109
100
|
const oxcMinifyCompress = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (_minifyOptions_oxc = minifyOptions.oxc) ? void 0 : _minifyOptions_oxc.compress) ? minifyOptions.oxc.compress : {};
|
|
110
101
|
const ProgressPlugin = isRspack ? rspack_cjs_namespaceObject.ProgressRspackPlugin : webpack_cjs_namespaceObject.ProgressWebpackPlugin;
|
|
111
102
|
const wasmFilename = 'js/[hash].module.wasm';
|
|
@@ -122,19 +113,26 @@ var __webpack_exports__ = {};
|
|
|
122
113
|
stats: 'errors-only',
|
|
123
114
|
output: {
|
|
124
115
|
clean: true,
|
|
125
|
-
path: external_node_path_default().resolve(unpackConfig.root, null == (
|
|
126
|
-
filename:
|
|
127
|
-
|
|
116
|
+
path: external_node_path_default().resolve(unpackConfig.root, null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.outDir),
|
|
117
|
+
filename: (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
118
|
+
type: 'js',
|
|
119
|
+
hash: null == (_unpackConfig_build3 = unpackConfig.build) ? void 0 : _unpackConfig_build3.filenameHash
|
|
120
|
+
}),
|
|
121
|
+
chunkFilename: (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
122
|
+
type: 'js',
|
|
123
|
+
hash: null == (_unpackConfig_build4 = unpackConfig.build) ? void 0 : _unpackConfig_build4.filenameHash,
|
|
124
|
+
async: true
|
|
125
|
+
}),
|
|
128
126
|
crossOriginLoading: 'anonymous',
|
|
129
127
|
pathinfo: false,
|
|
130
|
-
publicPath: null == (
|
|
128
|
+
publicPath: null == (_unpackConfig_build5 = unpackConfig.build) ? void 0 : _unpackConfig_build5.publicPath,
|
|
131
129
|
webassemblyModuleFilename: wasmFilename,
|
|
132
130
|
assetModuleFilename: 'assets/[name].[contenthash:8][ext]'
|
|
133
131
|
},
|
|
134
132
|
infrastructureLogging: {
|
|
135
133
|
level: 'error'
|
|
136
134
|
},
|
|
137
|
-
devtool: null == (
|
|
135
|
+
devtool: null == (_unpackConfig_build6 = unpackConfig.build) ? void 0 : _unpackConfig_build6.sourceMap,
|
|
138
136
|
module: {
|
|
139
137
|
rules: [
|
|
140
138
|
{
|
|
@@ -179,15 +177,17 @@ var __webpack_exports__ = {};
|
|
|
179
177
|
'main'
|
|
180
178
|
]
|
|
181
179
|
}),
|
|
182
|
-
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, external_utils_cjs_namespaceObject.isProd)() && new BundleAnalyzerPlugin(
|
|
180
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, external_utils_cjs_namespaceObject.isProd)() && new BundleAnalyzerPlugin({
|
|
181
|
+
analyzerPort: 'auto'
|
|
182
|
+
}),
|
|
183
183
|
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
184
184
|
resourceRegExp: /^\.\/locale$/,
|
|
185
185
|
contextRegExp: /moment$/
|
|
186
186
|
}),
|
|
187
|
-
(null == (
|
|
187
|
+
(null == (_unpackConfig_build7 = unpackConfig.build) ? void 0 : _unpackConfig_build7.copy) && new CopyPlugin({
|
|
188
188
|
patterns: unpackConfig.build.copy
|
|
189
189
|
}),
|
|
190
|
-
unpackConfig.typeCheck && (0, external_utils_cjs_namespaceObject.isDev)() && isTs && new TsCheckerRspackPlugin({
|
|
190
|
+
unpackConfig.typeCheck && (0, external_utils_cjs_namespaceObject.isDev)() && isTs && new external_ts_checker_rspack_plugin_namespaceObject.TsCheckerRspackPlugin({
|
|
191
191
|
typescript: {
|
|
192
192
|
mode: 'readonly',
|
|
193
193
|
memoryLimit: 8192,
|
|
@@ -251,7 +251,7 @@ var __webpack_exports__ = {};
|
|
|
251
251
|
},
|
|
252
252
|
optimization: {
|
|
253
253
|
moduleIds: (0, external_utils_cjs_namespaceObject.isDev)() ? 'named' : 'deterministic',
|
|
254
|
-
minimize: Boolean(null == (
|
|
254
|
+
minimize: Boolean(null == (_unpackConfig_build8 = unpackConfig.build) ? void 0 : _unpackConfig_build8.minify),
|
|
255
255
|
minimizer: [
|
|
256
256
|
new external_jsMinify_cjs_namespaceObject.JsMinifyPlugin({
|
|
257
257
|
...minifyOptions.oxc,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAyBzE,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgOhG"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import __rslib_shim_module__ from 'module';
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_bundle_analyzer_index_js_fd7b218e__ from "../../compiled/webpack-bundle-analyzer/index.js";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_copy_webpack_plugin_34f78a42__ from "copy-webpack-plugin";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_ts_checker_rspack_plugin_59177e58__ from "ts-checker-rspack-plugin";
|
|
6
4
|
import node_fs from "node:fs";
|
|
7
5
|
import node_path from "node:path";
|
|
8
6
|
import { rspack } from "@rspack/core";
|
|
7
|
+
import copy_webpack_plugin from "copy-webpack-plugin";
|
|
9
8
|
import html_webpack_plugin from "html-webpack-plugin";
|
|
10
|
-
import { getNodeEnv, isDev, isDevServer, isFunction, isPlainObject, isProd, mergeConfig } from "../utils.js";
|
|
11
9
|
import json5 from "json5";
|
|
12
10
|
import { DEFAULT_ES_TARGET, DEFAULT_LIGHTNINGCSS_TARGET, NODE_MODULES_REGEX, TEMPLATE_CONTENT } from "../constants.js";
|
|
13
11
|
import { LightningcssMinifyPlugin } from "../lightningcss/minimizer.js";
|
|
14
12
|
import { loadEnv } from "../loadEnv.js";
|
|
15
13
|
import { getNormalizedPluginsByHook } from "../plugin.js";
|
|
14
|
+
import { getNodeEnv, isDev, isDevServer, isFunction, isPlainObject, isProd, mergeConfig } from "../utils.js";
|
|
15
|
+
import { TsCheckerRspackPlugin } from "ts-checker-rspack-plugin";
|
|
16
16
|
import webpack from "webpack";
|
|
17
17
|
import { applyCacheConfig } from "./cache.js";
|
|
18
18
|
import { applyChunkSplitConfig } from "./chunkSplit.js";
|
|
@@ -26,12 +26,6 @@ import { ProgressWebpackPlugin } from "./progress/webpack.js";
|
|
|
26
26
|
var __webpack_modules__ = {
|
|
27
27
|
"../../compiled/webpack-bundle-analyzer/index.js": function(module) {
|
|
28
28
|
module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_webpack_bundle_analyzer_index_js_fd7b218e__;
|
|
29
|
-
},
|
|
30
|
-
"copy-webpack-plugin": function(module) {
|
|
31
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_copy_webpack_plugin_34f78a42__;
|
|
32
|
-
},
|
|
33
|
-
"ts-checker-rspack-plugin": function(module) {
|
|
34
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_ts_checker_rspack_plugin_59177e58__;
|
|
35
29
|
}
|
|
36
30
|
};
|
|
37
31
|
var __webpack_module_cache__ = {};
|
|
@@ -44,20 +38,14 @@ function __webpack_require__(moduleId) {
|
|
|
44
38
|
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
45
39
|
return module.exports;
|
|
46
40
|
}
|
|
47
|
-
const { TsCheckerRspackPlugin } = __webpack_require__("ts-checker-rspack-plugin");
|
|
48
41
|
const BundleAnalyzerPlugin = __webpack_require__("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
49
|
-
const CopyWebpackPlugin = __webpack_require__("copy-webpack-plugin");
|
|
50
42
|
async function getBundlerConfig(unpackConfig) {
|
|
51
|
-
var _unpackConfig_build, _unpackConfig_build1,
|
|
43
|
+
var _unpackConfig_build, _unpackConfig_build1, _minifyOptions_oxc, _unpackConfig_build2, _unpackConfig_build3, _unpackConfig_build4, _unpackConfig_build5, _unpackConfig_build6, _unpackConfig_html, _unpackConfig_html1, _unpackConfig_html2, _unpackConfig_html3, _unpackConfig_html4, _unpackConfig_html5, _unpackConfig_html6, _unpackConfig_html7, _unpackConfig_html8, _unpackConfig_performance, _unpackConfig_performance1, _unpackConfig_build7, _unpackConfig_resolve, _unpackConfig_resolve1, _unpackConfig_dev, _unpackConfig_build8, _unpackConfig_experiments;
|
|
52
44
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
53
45
|
const HtmlPlugin = isRspack ? rspack.HtmlRspackPlugin : html_webpack_plugin;
|
|
54
46
|
const definePlugin = (define)=>isRspack ? new rspack.DefinePlugin(define) : new webpack.DefinePlugin(define);
|
|
55
|
-
const JS_FILENAME = getOutputFilename({
|
|
56
|
-
type: 'js',
|
|
57
|
-
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
58
|
-
});
|
|
59
47
|
const IgnorePlugin = isRspack ? rspack.IgnorePlugin : webpack.IgnorePlugin;
|
|
60
|
-
const CopyPlugin = isRspack ? rspack.CopyRspackPlugin :
|
|
48
|
+
const CopyPlugin = isRspack ? rspack.CopyRspackPlugin : copy_webpack_plugin;
|
|
61
49
|
const tsconfigPath = node_path.resolve(unpackConfig.root, 'tsconfig.json');
|
|
62
50
|
const isTs = node_fs.existsSync(tsconfigPath);
|
|
63
51
|
const getAliasFromTsconfig = ()=>{
|
|
@@ -68,7 +56,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
68
56
|
return acc;
|
|
69
57
|
}, {}) : {};
|
|
70
58
|
};
|
|
71
|
-
const minifyOptions = isPlainObject(null == (
|
|
59
|
+
const minifyOptions = isPlainObject(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.minify) ? null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.minify : {};
|
|
72
60
|
const oxcMinifyCompress = isPlainObject(null == (_minifyOptions_oxc = minifyOptions.oxc) ? void 0 : _minifyOptions_oxc.compress) ? minifyOptions.oxc.compress : {};
|
|
73
61
|
const ProgressPlugin = isRspack ? ProgressRspackPlugin : ProgressWebpackPlugin;
|
|
74
62
|
const wasmFilename = 'js/[hash].module.wasm';
|
|
@@ -85,19 +73,26 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
85
73
|
stats: 'errors-only',
|
|
86
74
|
output: {
|
|
87
75
|
clean: true,
|
|
88
|
-
path: node_path.resolve(unpackConfig.root, null == (
|
|
89
|
-
filename:
|
|
90
|
-
|
|
76
|
+
path: node_path.resolve(unpackConfig.root, null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.outDir),
|
|
77
|
+
filename: getOutputFilename({
|
|
78
|
+
type: 'js',
|
|
79
|
+
hash: null == (_unpackConfig_build3 = unpackConfig.build) ? void 0 : _unpackConfig_build3.filenameHash
|
|
80
|
+
}),
|
|
81
|
+
chunkFilename: getOutputFilename({
|
|
82
|
+
type: 'js',
|
|
83
|
+
hash: null == (_unpackConfig_build4 = unpackConfig.build) ? void 0 : _unpackConfig_build4.filenameHash,
|
|
84
|
+
async: true
|
|
85
|
+
}),
|
|
91
86
|
crossOriginLoading: 'anonymous',
|
|
92
87
|
pathinfo: false,
|
|
93
|
-
publicPath: null == (
|
|
88
|
+
publicPath: null == (_unpackConfig_build5 = unpackConfig.build) ? void 0 : _unpackConfig_build5.publicPath,
|
|
94
89
|
webassemblyModuleFilename: wasmFilename,
|
|
95
90
|
assetModuleFilename: 'assets/[name].[contenthash:8][ext]'
|
|
96
91
|
},
|
|
97
92
|
infrastructureLogging: {
|
|
98
93
|
level: 'error'
|
|
99
94
|
},
|
|
100
|
-
devtool: null == (
|
|
95
|
+
devtool: null == (_unpackConfig_build6 = unpackConfig.build) ? void 0 : _unpackConfig_build6.sourceMap,
|
|
101
96
|
module: {
|
|
102
97
|
rules: [
|
|
103
98
|
{
|
|
@@ -142,12 +137,14 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
142
137
|
'main'
|
|
143
138
|
]
|
|
144
139
|
}),
|
|
145
|
-
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && isProd() && new BundleAnalyzerPlugin(
|
|
140
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && isProd() && new BundleAnalyzerPlugin({
|
|
141
|
+
analyzerPort: 'auto'
|
|
142
|
+
}),
|
|
146
143
|
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
147
144
|
resourceRegExp: /^\.\/locale$/,
|
|
148
145
|
contextRegExp: /moment$/
|
|
149
146
|
}),
|
|
150
|
-
(null == (
|
|
147
|
+
(null == (_unpackConfig_build7 = unpackConfig.build) ? void 0 : _unpackConfig_build7.copy) && new CopyPlugin({
|
|
151
148
|
patterns: unpackConfig.build.copy
|
|
152
149
|
}),
|
|
153
150
|
unpackConfig.typeCheck && isDev() && isTs && new TsCheckerRspackPlugin({
|
|
@@ -214,7 +211,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
214
211
|
},
|
|
215
212
|
optimization: {
|
|
216
213
|
moduleIds: isDev() ? 'named' : 'deterministic',
|
|
217
|
-
minimize: Boolean(null == (
|
|
214
|
+
minimize: Boolean(null == (_unpackConfig_build8 = unpackConfig.build) ? void 0 : _unpackConfig_build8.minify),
|
|
218
215
|
minimizer: [
|
|
219
216
|
new JsMinifyPlugin({
|
|
220
217
|
...minifyOptions.oxc,
|
|
@@ -75,7 +75,7 @@ function printDevLog(compiler, root) {
|
|
|
75
75
|
external_logger_cjs_namespaceObject.logger.wait(`building ${external_colors_cjs_namespaceObject.colors.dim(`removed ${fileInfo}`)}`);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
external_logger_cjs_namespaceObject.logger.wait('
|
|
78
|
+
external_logger_cjs_namespaceObject.logger.wait('building...');
|
|
79
79
|
}
|
|
80
80
|
async function compileDone(compiler, stats) {
|
|
81
81
|
const statsJson = stats.toJson({
|
|
@@ -38,7 +38,7 @@ function printDevLog(compiler, root) {
|
|
|
38
38
|
logger.wait(`building ${colors.dim(`removed ${fileInfo}`)}`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
logger.wait('
|
|
41
|
+
logger.wait('building...');
|
|
42
42
|
}
|
|
43
43
|
async function compileDone(compiler, stats) {
|
|
44
44
|
const statsJson = stats.toJson({
|
|
@@ -45,7 +45,7 @@ class ProgressRspackPlugin extends core_namespaceObject.rspack.ProgressPlugin {
|
|
|
45
45
|
apply(compiler) {
|
|
46
46
|
super.apply(compiler);
|
|
47
47
|
compiler.hooks.watchRun.tap(PLUGIN_NAME, ()=>{
|
|
48
|
-
(0, external_helpers_cjs_namespaceObject.printDevLog)(compiler, compiler.options.context);
|
|
48
|
+
if (global.__unpack_dev_server_started) (0, external_helpers_cjs_namespaceObject.printDevLog)(compiler, compiler.options.context);
|
|
49
49
|
});
|
|
50
50
|
compiler.hooks.afterDone.tap(PLUGIN_NAME, async (stats)=>{
|
|
51
51
|
await (0, external_helpers_cjs_namespaceObject.compileDone)(compiler, stats);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/progress/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAK7C,qBAAa,oBAAqB,SAAQ,MAAM,CAAC,cAAc;IAC7D,WAAW,cAAoB;;IAO/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/progress/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAK7C,qBAAa,oBAAqB,SAAQ,MAAM,CAAC,cAAc;IAC7D,WAAW,cAAoB;;IAO/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAWhC"}
|
|
@@ -19,7 +19,7 @@ class ProgressRspackPlugin extends rspack.ProgressPlugin {
|
|
|
19
19
|
apply(compiler) {
|
|
20
20
|
super.apply(compiler);
|
|
21
21
|
compiler.hooks.watchRun.tap(PLUGIN_NAME, ()=>{
|
|
22
|
-
printDevLog(compiler, compiler.options.context);
|
|
22
|
+
if (global.__unpack_dev_server_started) printDevLog(compiler, compiler.options.context);
|
|
23
23
|
});
|
|
24
24
|
compiler.hooks.afterDone.tap(PLUGIN_NAME, async (stats)=>{
|
|
25
25
|
await compileDone(compiler, stats);
|
|
@@ -55,7 +55,7 @@ class ProgressWebpackPlugin extends external_webpack_default().ProgressPlugin {
|
|
|
55
55
|
apply(compiler) {
|
|
56
56
|
super.apply(compiler);
|
|
57
57
|
compiler.hooks.watchRun.tap(PLUGIN_NAME, ()=>{
|
|
58
|
-
(0, external_helpers_cjs_namespaceObject.printDevLog)(compiler, compiler.options.context);
|
|
58
|
+
if (global.__unpack_dev_server_started) (0, external_helpers_cjs_namespaceObject.printDevLog)(compiler, compiler.options.context);
|
|
59
59
|
});
|
|
60
60
|
compiler.hooks.afterDone.tap(PLUGIN_NAME, async (stats)=>{
|
|
61
61
|
this.isCompleted = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/progress/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,cAAc;IAC/D,WAAW,cAAoB;IAC/B,OAAO,CAAC,WAAW,CAAQ;;IAiB3B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/progress/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,cAAc;IAC/D,WAAW,cAAoB;IAC/B,OAAO,CAAC,WAAW,CAAQ;;IAiB3B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;CAcxC"}
|