gant-core 0.1.45 → 0.1.46
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/lib/cli/index.js +16 -7
- package/lib/cli/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/package.json +1 -1
package/lib/cli/index.js
CHANGED
|
@@ -24383,14 +24383,24 @@ var dist = CompressionPlugin;
|
|
|
24383
24383
|
var CompressionPlugin$1 = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
24384
24384
|
|
|
24385
24385
|
var getProConfig = (config, cwd) => {
|
|
24386
|
-
const { outputPathDir = "dist", optimization, library, compression = true } = config;
|
|
24386
|
+
const { outputPathDir = "dist", optimization, library, compression = true, terserOptions } = config;
|
|
24387
24387
|
const plugins = [];
|
|
24388
|
+
const terserPluginOptions = {
|
|
24389
|
+
exclude: /node_modules/, // 排除 node_modules 目录
|
|
24390
|
+
...terserOptions,
|
|
24391
|
+
extractComments: false,
|
|
24392
|
+
terserOptions: {
|
|
24393
|
+
compress: true,
|
|
24394
|
+
mangle: true,
|
|
24395
|
+
...terserOptions?.terserOptions
|
|
24396
|
+
},
|
|
24397
|
+
};
|
|
24388
24398
|
if (library)
|
|
24389
24399
|
return mergeConfig$1({
|
|
24390
24400
|
mode: "production",
|
|
24391
24401
|
optimization: {
|
|
24392
24402
|
minimize: true,
|
|
24393
|
-
minimizer: [new CssMinimizerPlugin(), new TerserPlugin()],
|
|
24403
|
+
minimizer: [new CssMinimizerPlugin(), new TerserPlugin(terserPluginOptions)],
|
|
24394
24404
|
...optimization,
|
|
24395
24405
|
},
|
|
24396
24406
|
plugins: [
|
|
@@ -24410,9 +24420,7 @@ var getProConfig = (config, cwd) => {
|
|
|
24410
24420
|
mode: "production",
|
|
24411
24421
|
optimization: {
|
|
24412
24422
|
minimize: true,
|
|
24413
|
-
minimizer: [new CssMinimizerPlugin(), new TerserPlugin(
|
|
24414
|
-
extractComments: false,
|
|
24415
|
-
})],
|
|
24423
|
+
minimizer: [new CssMinimizerPlugin(), new TerserPlugin(terserPluginOptions)],
|
|
24416
24424
|
runtimeChunk: 'single',
|
|
24417
24425
|
...optimization,
|
|
24418
24426
|
splitChunks: {
|
|
@@ -24539,7 +24547,8 @@ const OMIT_NAMES_ALL = [
|
|
|
24539
24547
|
'setting',
|
|
24540
24548
|
'vue',
|
|
24541
24549
|
'library',
|
|
24542
|
-
'compression'
|
|
24550
|
+
'compression',
|
|
24551
|
+
'terserOptions',
|
|
24543
24552
|
];
|
|
24544
24553
|
const hasIndex = (routes, mpa) => {
|
|
24545
24554
|
if (isEmpty$2(routes) || isEmpty$2(mpa))
|
|
@@ -66814,7 +66823,7 @@ const createCwdConfig = (cwd, name, vue) => {
|
|
|
66814
66823
|
};
|
|
66815
66824
|
|
|
66816
66825
|
var name = "gant-core";
|
|
66817
|
-
var version = "0.1.
|
|
66826
|
+
var version = "0.1.46";
|
|
66818
66827
|
var description = "";
|
|
66819
66828
|
var main = "lib/index.js";
|
|
66820
66829
|
var bin = {
|