@unpackjs/core 1.7.10 → 1.7.12
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/portfinder/index.d.ts +21 -1
- package/compiled/portfinder/index.js +33 -14
- package/compiled/portfinder/package.json +1 -1
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/style-loader/index.js +10 -10
- package/dist/bundler-config/css.cjs +16 -16
- package/dist/bundler-config/css.js +19 -19
- package/dist/bundler-config/experimentCss.cjs +15 -15
- package/dist/bundler-config/experimentCss.js +17 -17
- package/dist/bundler-config/index.cjs +35 -23
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +35 -23
- package/dist/bundler-config/jsMinify.cjs +1 -1
- package/dist/bundler-config/jsMinify.js +1 -1
- package/dist/colors.cjs +2 -2
- package/dist/colors.js +2 -2
- package/dist/config.js +2 -2
- package/dist/createUnpack.cjs +2 -2
- package/dist/createUnpack.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +7 -39
- package/dist/lightningcss/loader.cjs +2 -2
- package/dist/lightningcss/loader.js +2 -2
- package/dist/lightningcss/minimizer.cjs +3 -3
- package/dist/lightningcss/minimizer.js +3 -3
- package/dist/logger.cjs +2 -2
- package/dist/logger.js +2 -2
- package/dist/openBrowser.cjs +2 -2
- package/dist/openBrowser.js +4 -4
- package/dist/prebundleDeps.cjs +3 -9
- package/dist/prebundleDeps.js +3 -9
- package/dist/run/dev.cjs +5 -5
- package/dist/run/dev.js +5 -5
- package/dist/typed-css-modules/loader.cjs +4 -10
- package/dist/typed-css-modules/loader.js +4 -10
- package/dist/typed-css-modules/plugin.cjs +1 -1
- package/dist/typed-css-modules/plugin.js +1 -1
- package/dist/types/logger.js +2 -2
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +5 -5
- package/package.json +5 -5
|
@@ -8,11 +8,11 @@ import * as __WEBPACK_EXTERNAL_MODULE_mini_css_extract_plugin_0b345af5__ from "m
|
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__ from "../constants.js";
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
|
|
10
10
|
import * as __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__ from "./helper.js";
|
|
11
|
-
var
|
|
11
|
+
var css_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
12
12
|
function applyCssConfig({ config, unpackConfig }) {
|
|
13
13
|
var _unpackConfig_css, _unpackConfig_build, _unpackConfig_css1, _unpackConfig_css2, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _unpackConfig_css3, _unpackConfig_css4, _config_module_rules2, _config_module2;
|
|
14
14
|
const MiniCssExtractPlugin = 'rspack' === unpackConfig.bundler ? __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.CssExtractRspackPlugin : __WEBPACK_EXTERNAL_MODULE_mini_css_extract_plugin_0b345af5__["default"];
|
|
15
|
-
let modules = null
|
|
15
|
+
let modules = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.modules;
|
|
16
16
|
if (!(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isPlainObject)(modules) && false !== modules) modules = {};
|
|
17
17
|
const getAutoOption = ()=>{
|
|
18
18
|
if (false === modules) return false;
|
|
@@ -37,7 +37,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() && {
|
|
40
|
-
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(
|
|
40
|
+
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(css_dirname, '../typed-css-modules/loader.cjs'),
|
|
41
41
|
options: {
|
|
42
42
|
modules
|
|
43
43
|
}
|
|
@@ -52,7 +52,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
52
52
|
exportLocalsConvention: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.EXPORT_LOCALS_CONVENTION,
|
|
53
53
|
namedExport: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_NAMED_EXPORT
|
|
54
54
|
},
|
|
55
|
-
sourceMap: null
|
|
55
|
+
sourceMap: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
].filter(Boolean);
|
|
@@ -62,17 +62,17 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
62
62
|
config.plugins.push(new MiniCssExtractPlugin({
|
|
63
63
|
filename: (0, __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__.getOutputFilename)({
|
|
64
64
|
type: 'css',
|
|
65
|
-
hash: null
|
|
65
|
+
hash: null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.filenameHash
|
|
66
66
|
})
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
|
-
null
|
|
69
|
+
null == (_config_module = config.module) || null == (_config_module_rules = _config_module.rules) || _config_module_rules.push({
|
|
70
70
|
test: /\.less$/i,
|
|
71
71
|
use: [
|
|
72
72
|
...getCommonRules({
|
|
73
73
|
importLoaders: 1
|
|
74
74
|
}),
|
|
75
|
-
(null
|
|
75
|
+
(null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
76
76
|
loader: require.resolve('thread-loader'),
|
|
77
77
|
options: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.THREAD_OPTIONS
|
|
78
78
|
},
|
|
@@ -81,9 +81,9 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
81
81
|
options: {
|
|
82
82
|
lessOptions: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)({
|
|
83
83
|
javascriptEnabled: true
|
|
84
|
-
}, (null
|
|
84
|
+
}, (null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.less) || {}),
|
|
85
85
|
implementation: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getUserDepPath)(unpackConfig.root, 'less'),
|
|
86
|
-
sourceMap: null
|
|
86
|
+
sourceMap: null == (_unpackConfig_css2 = unpackConfig.css) ? void 0 : _unpackConfig_css2.sourceMap
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
].filter(Boolean)
|
|
@@ -91,9 +91,9 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
91
91
|
const getLightningcssLoader = ()=>{
|
|
92
92
|
var _unpackConfig_css, _unpackConfig_css1;
|
|
93
93
|
return {
|
|
94
|
-
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(
|
|
95
|
-
options: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)((null
|
|
96
|
-
sourceMap: null
|
|
94
|
+
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(css_dirname, '../lightningcss/loader.cjs'),
|
|
95
|
+
options: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
96
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
97
97
|
})
|
|
98
98
|
};
|
|
99
99
|
};
|
|
@@ -102,16 +102,16 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
102
102
|
return {
|
|
103
103
|
loader: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getCompiledPkgPath)('postcss-loader'),
|
|
104
104
|
options: {
|
|
105
|
-
postcssOptions: null
|
|
106
|
-
sourceMap: null
|
|
105
|
+
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
106
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
110
|
const getCssLoader = ()=>{
|
|
111
111
|
var _unpackConfig_css;
|
|
112
|
-
return (null
|
|
112
|
+
return (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.transformer) === 'lightningcss' ? getLightningcssLoader() : getPostcssLoader();
|
|
113
113
|
};
|
|
114
|
-
null
|
|
114
|
+
null == (_config_module1 = config.module) || null == (_config_module_rules1 = _config_module1.rules) || _config_module_rules1.push({
|
|
115
115
|
test: /\.css$/i,
|
|
116
116
|
use: [
|
|
117
117
|
...getCommonRules({
|
|
@@ -120,7 +120,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
120
120
|
getCssLoader()
|
|
121
121
|
]
|
|
122
122
|
});
|
|
123
|
-
null
|
|
123
|
+
null == (_config_module2 = config.module) || null == (_config_module_rules2 = _config_module2.rules) || _config_module_rules2.push({
|
|
124
124
|
test: /\.s[ac]ss$/i,
|
|
125
125
|
use: [
|
|
126
126
|
...getCommonRules({
|
|
@@ -134,8 +134,8 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
134
134
|
'sass-embedded',
|
|
135
135
|
'sass'
|
|
136
136
|
]),
|
|
137
|
-
sassOptions: null
|
|
138
|
-
sourceMap: null
|
|
137
|
+
sassOptions: null == (_unpackConfig_css3 = unpackConfig.css) ? void 0 : _unpackConfig_css3.sass,
|
|
138
|
+
sourceMap: null == (_unpackConfig_css4 = unpackConfig.css) ? void 0 : _unpackConfig_css4.sourceMap
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
]
|
|
@@ -45,7 +45,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
45
45
|
var _unpackConfig_build, _unpackConfig_css, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
46
46
|
const CSS_FILENAME = (0, external_helper_cjs_namespaceObject.getOutputFilename)({
|
|
47
47
|
type: 'css',
|
|
48
|
-
hash: null
|
|
48
|
+
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
49
49
|
});
|
|
50
50
|
config.output.cssFilename = CSS_FILENAME;
|
|
51
51
|
config.output.cssChunkFilename = CSS_FILENAME;
|
|
@@ -53,7 +53,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
53
53
|
'experiments',
|
|
54
54
|
'css'
|
|
55
55
|
], true);
|
|
56
|
-
let modules = null
|
|
56
|
+
let modules = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.modules;
|
|
57
57
|
if (!(0, external_utils_cjs_namespaceObject.isPlainObject)(modules) && false !== modules) modules = {};
|
|
58
58
|
if (false !== modules && false !== modules.auto) {
|
|
59
59
|
(0, external_utils_cjs_namespaceObject.setValueByPath)(config, [
|
|
@@ -89,7 +89,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
89
89
|
};
|
|
90
90
|
const getThreadLoader = ()=>{
|
|
91
91
|
var _unpackConfig_build;
|
|
92
|
-
return (null
|
|
92
|
+
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
93
93
|
loader: require.resolve('thread-loader'),
|
|
94
94
|
options: external_constants_cjs_namespaceObject.THREAD_OPTIONS
|
|
95
95
|
};
|
|
@@ -101,13 +101,13 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
101
101
|
options: {
|
|
102
102
|
lessOptions: (0, external_utils_cjs_namespaceObject.mergeConfig)({
|
|
103
103
|
javascriptEnabled: true
|
|
104
|
-
}, (null
|
|
104
|
+
}, (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.less) || {}),
|
|
105
105
|
implementation: (0, external_utils_cjs_namespaceObject.getUserDepPath)(unpackConfig.root, 'less'),
|
|
106
|
-
sourceMap: null
|
|
106
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
null
|
|
110
|
+
null == (_config_module = config.module) || null == (_config_module_rules = _config_module.rules) || _config_module_rules.push({
|
|
111
111
|
test: /\.less$/i,
|
|
112
112
|
oneOf: [
|
|
113
113
|
withCssModules({
|
|
@@ -129,8 +129,8 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
129
129
|
var _unpackConfig_css, _unpackConfig_css1;
|
|
130
130
|
return {
|
|
131
131
|
loader: external_node_path_default().resolve(__dirname, '../lightningcss/loader.cjs'),
|
|
132
|
-
options: (0, external_utils_cjs_namespaceObject.mergeConfig)((null
|
|
133
|
-
sourceMap: null
|
|
132
|
+
options: (0, external_utils_cjs_namespaceObject.mergeConfig)((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
133
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
134
134
|
})
|
|
135
135
|
};
|
|
136
136
|
};
|
|
@@ -139,16 +139,16 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
139
139
|
return {
|
|
140
140
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('postcss-loader'),
|
|
141
141
|
options: {
|
|
142
|
-
postcssOptions: null
|
|
143
|
-
sourceMap: null
|
|
142
|
+
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
143
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
147
|
const getCssLoader = ()=>{
|
|
148
148
|
var _unpackConfig_css;
|
|
149
|
-
return (null
|
|
149
|
+
return (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.transformer) === 'lightningcss' ? getLightningcssLoader() : getPostcssLoader();
|
|
150
150
|
};
|
|
151
|
-
null
|
|
151
|
+
null == (_config_module1 = config.module) || null == (_config_module_rules1 = _config_module1.rules) || _config_module_rules1.push({
|
|
152
152
|
test: /\.css$/i,
|
|
153
153
|
oneOf: [
|
|
154
154
|
withCssModules({
|
|
@@ -174,12 +174,12 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
174
174
|
'sass-embedded',
|
|
175
175
|
'sass'
|
|
176
176
|
]),
|
|
177
|
-
sassOptions: null
|
|
178
|
-
sourceMap: null
|
|
177
|
+
sassOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sass,
|
|
178
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
|
-
null
|
|
182
|
+
null == (_config_module2 = config.module) || null == (_config_module_rules2 = _config_module2.rules) || _config_module_rules2.push({
|
|
183
183
|
test: /\.s[ac]ss$/i,
|
|
184
184
|
oneOf: [
|
|
185
185
|
withCssModules({
|
|
@@ -7,12 +7,12 @@ import * as __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__ from "../constant
|
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__typed_css_modules_plugin_js_c181893e__ from "../typed-css-modules/plugin.js";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__ from "./helper.js";
|
|
10
|
-
var
|
|
10
|
+
var experimentCss_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
11
11
|
function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
12
12
|
var _unpackConfig_build, _unpackConfig_css, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
13
13
|
const CSS_FILENAME = (0, __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__.getOutputFilename)({
|
|
14
14
|
type: 'css',
|
|
15
|
-
hash: null
|
|
15
|
+
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
16
16
|
});
|
|
17
17
|
config.output.cssFilename = CSS_FILENAME;
|
|
18
18
|
config.output.cssChunkFilename = CSS_FILENAME;
|
|
@@ -20,7 +20,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
20
20
|
'experiments',
|
|
21
21
|
'css'
|
|
22
22
|
], true);
|
|
23
|
-
let modules = null
|
|
23
|
+
let modules = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.modules;
|
|
24
24
|
if (!(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isPlainObject)(modules) && false !== modules) modules = {};
|
|
25
25
|
if (false !== modules && false !== modules.auto) {
|
|
26
26
|
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.setValueByPath)(config, [
|
|
@@ -56,7 +56,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
56
56
|
};
|
|
57
57
|
const getThreadLoader = ()=>{
|
|
58
58
|
var _unpackConfig_build;
|
|
59
|
-
return (null
|
|
59
|
+
return (null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.parallel) && {
|
|
60
60
|
loader: require.resolve('thread-loader'),
|
|
61
61
|
options: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.THREAD_OPTIONS
|
|
62
62
|
};
|
|
@@ -68,13 +68,13 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
68
68
|
options: {
|
|
69
69
|
lessOptions: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)({
|
|
70
70
|
javascriptEnabled: true
|
|
71
|
-
}, (null
|
|
71
|
+
}, (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.less) || {}),
|
|
72
72
|
implementation: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getUserDepPath)(unpackConfig.root, 'less'),
|
|
73
|
-
sourceMap: null
|
|
73
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
null
|
|
77
|
+
null == (_config_module = config.module) || null == (_config_module_rules = _config_module.rules) || _config_module_rules.push({
|
|
78
78
|
test: /\.less$/i,
|
|
79
79
|
oneOf: [
|
|
80
80
|
withCssModules({
|
|
@@ -95,9 +95,9 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
95
95
|
const getLightningcssLoader = ()=>{
|
|
96
96
|
var _unpackConfig_css, _unpackConfig_css1;
|
|
97
97
|
return {
|
|
98
|
-
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(
|
|
99
|
-
options: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)((null
|
|
100
|
-
sourceMap: null
|
|
98
|
+
loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(experimentCss_dirname, '../lightningcss/loader.cjs'),
|
|
99
|
+
options: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
100
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
101
101
|
})
|
|
102
102
|
};
|
|
103
103
|
};
|
|
@@ -106,16 +106,16 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
106
106
|
return {
|
|
107
107
|
loader: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getCompiledPkgPath)('postcss-loader'),
|
|
108
108
|
options: {
|
|
109
|
-
postcssOptions: null
|
|
110
|
-
sourceMap: null
|
|
109
|
+
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
110
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
const getCssLoader = ()=>{
|
|
115
115
|
var _unpackConfig_css;
|
|
116
|
-
return (null
|
|
116
|
+
return (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.transformer) === 'lightningcss' ? getLightningcssLoader() : getPostcssLoader();
|
|
117
117
|
};
|
|
118
|
-
null
|
|
118
|
+
null == (_config_module1 = config.module) || null == (_config_module_rules1 = _config_module1.rules) || _config_module_rules1.push({
|
|
119
119
|
test: /\.css$/i,
|
|
120
120
|
oneOf: [
|
|
121
121
|
withCssModules({
|
|
@@ -141,12 +141,12 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
141
141
|
'sass-embedded',
|
|
142
142
|
'sass'
|
|
143
143
|
]),
|
|
144
|
-
sassOptions: null
|
|
145
|
-
sourceMap: null
|
|
144
|
+
sassOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sass,
|
|
145
|
+
sourceMap: null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.sourceMap
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
null
|
|
149
|
+
null == (_config_module2 = config.module) || null == (_config_module_rules2 = _config_module2.rules) || _config_module_rules2.push({
|
|
150
150
|
test: /\.s[ac]ss$/i,
|
|
151
151
|
oneOf: [
|
|
152
152
|
withCssModules({
|
|
@@ -88,7 +88,7 @@ var __webpack_exports__ = {};
|
|
|
88
88
|
const definePlugin = (define)=>isRspack ? new core_namespaceObject.rspack.DefinePlugin(define) : new (external_webpack_default()).DefinePlugin(define);
|
|
89
89
|
const JS_FILENAME = (0, external_helper_cjs_namespaceObject.getOutputFilename)({
|
|
90
90
|
type: 'js',
|
|
91
|
-
hash: null
|
|
91
|
+
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
92
92
|
});
|
|
93
93
|
const IgnorePlugin = isRspack ? core_namespaceObject.rspack.IgnorePlugin : external_webpack_default().IgnorePlugin;
|
|
94
94
|
const CopyPlugin = isRspack ? core_namespaceObject.rspack.CopyRspackPlugin : CopyWebpackPlugin;
|
|
@@ -96,14 +96,15 @@ var __webpack_exports__ = {};
|
|
|
96
96
|
const isTs = external_node_fs_default().existsSync(tsconfigPath);
|
|
97
97
|
const getAliasFromTsconfig = ()=>{
|
|
98
98
|
var _json5_parse_compilerOptions, _json5_parse;
|
|
99
|
-
const paths = null
|
|
99
|
+
const paths = null == (_json5_parse = external_json5_default().parse(external_node_fs_default().readFileSync(tsconfigPath, 'utf-8'))) ? void 0 : null == (_json5_parse_compilerOptions = _json5_parse.compilerOptions) ? void 0 : _json5_parse_compilerOptions.paths;
|
|
100
100
|
return paths ? Object.keys(paths).reduce((acc, key)=>{
|
|
101
101
|
acc[key.replace(/\/\*$/, '')] = external_node_path_default().resolve(unpackConfig.root, paths[key][0].replace(/\/\*$/, ''));
|
|
102
102
|
return acc;
|
|
103
103
|
}, {}) : {};
|
|
104
104
|
};
|
|
105
|
-
const minifyOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null
|
|
105
|
+
const minifyOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.minify) ? null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.minify : {};
|
|
106
106
|
const PluginProgress = isRspack ? rspack_cjs_namespaceObject.RspackPluginProgress : webpack_cjs_namespaceObject.WebpackPluginProgress;
|
|
107
|
+
const wasmFilename = 'js/[hash].module.wasm';
|
|
107
108
|
let config = {
|
|
108
109
|
context: unpackConfig.root,
|
|
109
110
|
mode: (0, external_utils_cjs_namespaceObject.isDev)() ? 'development' : 'production',
|
|
@@ -113,17 +114,18 @@ var __webpack_exports__ = {};
|
|
|
113
114
|
stats: 'errors-only',
|
|
114
115
|
output: {
|
|
115
116
|
clean: true,
|
|
116
|
-
path: external_node_path_default().resolve(unpackConfig.root, null
|
|
117
|
+
path: external_node_path_default().resolve(unpackConfig.root, null == (_unpackConfig_build3 = unpackConfig.build) ? void 0 : _unpackConfig_build3.outDir),
|
|
117
118
|
filename: JS_FILENAME,
|
|
118
119
|
chunkFilename: JS_FILENAME,
|
|
119
120
|
crossOriginLoading: 'anonymous',
|
|
120
121
|
pathinfo: false,
|
|
121
|
-
publicPath: null
|
|
122
|
+
publicPath: null == (_unpackConfig_build4 = unpackConfig.build) ? void 0 : _unpackConfig_build4.publicPath,
|
|
123
|
+
webassemblyModuleFilename: wasmFilename
|
|
122
124
|
},
|
|
123
125
|
infrastructureLogging: {
|
|
124
126
|
level: 'warn'
|
|
125
127
|
},
|
|
126
|
-
devtool: null
|
|
128
|
+
devtool: null == (_unpackConfig_build5 = unpackConfig.build) ? void 0 : _unpackConfig_build5.sourceMap,
|
|
127
129
|
module: {
|
|
128
130
|
rules: [
|
|
129
131
|
{
|
|
@@ -133,36 +135,44 @@ var __webpack_exports__ = {};
|
|
|
133
135
|
{
|
|
134
136
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
135
137
|
type: 'asset/resource'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
test: /\.wasm$/,
|
|
141
|
+
dependency: 'url',
|
|
142
|
+
type: 'asset/resource',
|
|
143
|
+
generator: {
|
|
144
|
+
filename: wasmFilename
|
|
145
|
+
}
|
|
136
146
|
}
|
|
137
147
|
]
|
|
138
148
|
},
|
|
139
149
|
plugins: [
|
|
140
150
|
unpackConfig.define && definePlugin(unpackConfig.define),
|
|
141
151
|
!unpackConfig.mpa && new HtmlPlugin({
|
|
142
|
-
template: (null
|
|
143
|
-
templateContent: (null
|
|
152
|
+
template: (null == (_unpackConfig_html = unpackConfig.html) ? void 0 : _unpackConfig_html.template) || (isRspack ? void 0 : ''),
|
|
153
|
+
templateContent: (null == (_unpackConfig_html1 = unpackConfig.html) ? void 0 : _unpackConfig_html1.templateContent) || ((null == (_unpackConfig_html2 = unpackConfig.html) ? void 0 : _unpackConfig_html2.template) ? isRspack ? void 0 : false : external_constants_cjs_namespaceObject.TEMPLATE_CONTENT),
|
|
144
154
|
templateParameters: {
|
|
145
|
-
mountId: null
|
|
146
|
-
title: (0, external_utils_cjs_namespaceObject.isFunction)(null
|
|
155
|
+
mountId: null == (_unpackConfig_html3 = unpackConfig.html) ? void 0 : _unpackConfig_html3.mountId,
|
|
156
|
+
title: (0, external_utils_cjs_namespaceObject.isFunction)(null == (_unpackConfig_html4 = unpackConfig.html) ? void 0 : _unpackConfig_html4.title) ? null == (_unpackConfig_html5 = unpackConfig.html) ? void 0 : _unpackConfig_html5.title({
|
|
147
157
|
entryName: 'index'
|
|
148
|
-
}) : (null
|
|
149
|
-
headTag: (null
|
|
150
|
-
...null
|
|
158
|
+
}) : (null == (_unpackConfig_html6 = unpackConfig.html) ? void 0 : _unpackConfig_html6.title) || '',
|
|
159
|
+
headTag: (null == (_unpackConfig_html7 = unpackConfig.html) ? void 0 : _unpackConfig_html7.headTag) || '',
|
|
160
|
+
...null == (_unpackConfig_html8 = unpackConfig.html) ? void 0 : _unpackConfig_html8.templateParameters
|
|
151
161
|
},
|
|
152
162
|
minify: false,
|
|
153
163
|
chunks: [
|
|
154
164
|
'main'
|
|
155
165
|
]
|
|
156
166
|
}),
|
|
157
|
-
(null
|
|
158
|
-
(null
|
|
167
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, external_utils_cjs_namespaceObject.isProd)() && new BundleAnalyzerPlugin(),
|
|
168
|
+
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
159
169
|
resourceRegExp: /^\.\/locale$/,
|
|
160
170
|
contextRegExp: /moment$/
|
|
161
171
|
}),
|
|
162
|
-
(null
|
|
172
|
+
(null == (_unpackConfig_build6 = unpackConfig.build) ? void 0 : _unpackConfig_build6.copy) && new CopyPlugin({
|
|
163
173
|
patterns: unpackConfig.build.copy
|
|
164
174
|
}),
|
|
165
|
-
(null
|
|
175
|
+
(null == (_unpackConfig_build7 = unpackConfig.build) ? void 0 : _unpackConfig_build7.typeCheck) && (0, external_utils_cjs_namespaceObject.isDev)() && isTs && new TsCheckerRspackPlugin({
|
|
166
176
|
typescript: {
|
|
167
177
|
mode: 'readonly',
|
|
168
178
|
memoryLimit: 8192,
|
|
@@ -194,26 +204,28 @@ var __webpack_exports__ = {};
|
|
|
194
204
|
alias: {
|
|
195
205
|
'@': external_node_path_default().resolve(unpackConfig.root, 'src'),
|
|
196
206
|
...isTs ? getAliasFromTsconfig() : {},
|
|
197
|
-
...null
|
|
207
|
+
...null == (_unpackConfig_resolve = unpackConfig.resolve) ? void 0 : _unpackConfig_resolve.alias
|
|
198
208
|
},
|
|
199
209
|
extensions: [
|
|
200
210
|
'.tsx',
|
|
201
211
|
'.ts',
|
|
202
212
|
'.jsx',
|
|
203
213
|
'.js',
|
|
204
|
-
|
|
214
|
+
'.wasm',
|
|
215
|
+
...(null == (_unpackConfig_resolve1 = unpackConfig.resolve) ? void 0 : _unpackConfig_resolve1.extensions) || []
|
|
205
216
|
]
|
|
206
217
|
},
|
|
207
218
|
experiments: {
|
|
208
|
-
lazyCompilation: (null
|
|
219
|
+
lazyCompilation: (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.lazyCompilation) && (0, external_utils_cjs_namespaceObject.isDevServer)(),
|
|
209
220
|
css: false,
|
|
221
|
+
asyncWebAssembly: true,
|
|
210
222
|
...isRspack && (0, external_utils_cjs_namespaceObject.isDev)() ? {
|
|
211
223
|
incremental: true
|
|
212
224
|
} : {}
|
|
213
225
|
},
|
|
214
226
|
optimization: {
|
|
215
227
|
moduleIds: (0, external_utils_cjs_namespaceObject.isDev)() ? 'named' : 'deterministic',
|
|
216
|
-
minimize: Boolean(null
|
|
228
|
+
minimize: Boolean(null == (_unpackConfig_build8 = unpackConfig.build) ? void 0 : _unpackConfig_build8.minify),
|
|
217
229
|
minimizer: [
|
|
218
230
|
new external_jsMinify_cjs_namespaceObject.JsMinifyPlugin({
|
|
219
231
|
target: external_constants_cjs_namespaceObject.ESBUILD_TARGET
|
|
@@ -221,14 +233,14 @@ var __webpack_exports__ = {};
|
|
|
221
233
|
new minimizer_cjs_namespaceObject.LightningcssMinifyPlugin(minifyOptions.lightningcss)
|
|
222
234
|
]
|
|
223
235
|
},
|
|
224
|
-
cache: (null
|
|
236
|
+
cache: (null == (_unpackConfig_build9 = unpackConfig.build) ? void 0 : _unpackConfig_build9.cache) && 'webpack' === unpackConfig.bundler ? {
|
|
225
237
|
type: 'filesystem'
|
|
226
238
|
} : void 0,
|
|
227
239
|
watchOptions: {
|
|
228
240
|
ignored: /[\\/](?:\.git|node_modules)[\\/]/
|
|
229
241
|
}
|
|
230
242
|
};
|
|
231
|
-
config = (null
|
|
243
|
+
config = (null == (_unpackConfig_experiments = unpackConfig.experiments) ? void 0 : _unpackConfig_experiments.css) ? (0, external_experimentCss_cjs_namespaceObject.applyExperimentCssConfig)({
|
|
232
244
|
config,
|
|
233
245
|
unpackConfig
|
|
234
246
|
}) : (0, external_css_cjs_namespaceObject.applyCssConfig)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAmBzE,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAmBzE,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA+LhG"}
|