gant-core 0.1.35 → 0.1.37
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 +20 -16
- package/lib/cli/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/package.json +2 -1
- package/rollup.config.js +1 -0
package/lib/cli/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var webpack = require('webpack');
|
|
|
11
11
|
var WebDevServer = require('webpack-dev-server');
|
|
12
12
|
var MiniCssExtractPlugin$1 = require('mini-css-extract-plugin');
|
|
13
13
|
var CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
14
|
+
var TerserPlugin = require('terser-webpack-plugin');
|
|
14
15
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
15
16
|
var chokidar = require('chokidar');
|
|
16
17
|
var process$4 = require('node:process');
|
|
@@ -6321,7 +6322,19 @@ class CopyFolderPlugin {
|
|
|
6321
6322
|
}
|
|
6322
6323
|
|
|
6323
6324
|
var getProConfig = (config, cwd) => {
|
|
6324
|
-
const { outputPathDir = "dist", optimization } = config;
|
|
6325
|
+
const { outputPathDir = "dist", optimization, library } = config;
|
|
6326
|
+
if (library)
|
|
6327
|
+
return mergeConfig$1({
|
|
6328
|
+
mode: "production",
|
|
6329
|
+
optimization: {
|
|
6330
|
+
minimize: true,
|
|
6331
|
+
minimizer: [new CssMinimizerPlugin(), new TerserPlugin()],
|
|
6332
|
+
...optimization,
|
|
6333
|
+
},
|
|
6334
|
+
plugins: [
|
|
6335
|
+
new MiniCssExtractPlugin$1(),
|
|
6336
|
+
],
|
|
6337
|
+
}, config);
|
|
6325
6338
|
return mergeConfig$1({
|
|
6326
6339
|
mode: "production",
|
|
6327
6340
|
optimization: {
|
|
@@ -6367,8 +6380,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
6367
6380
|
const getCssRules = (mode) => {
|
|
6368
6381
|
return [
|
|
6369
6382
|
{
|
|
6370
|
-
test: /\.(
|
|
6371
|
-
exclude:
|
|
6383
|
+
test: /\.(less)$/,
|
|
6384
|
+
exclude: /node_modules|public/,
|
|
6372
6385
|
use: [
|
|
6373
6386
|
mode === 'development'
|
|
6374
6387
|
? require.resolve('style-loader')
|
|
@@ -6408,12 +6421,10 @@ const getCssRules = (mode) => {
|
|
|
6408
6421
|
},
|
|
6409
6422
|
},
|
|
6410
6423
|
},
|
|
6411
|
-
// 将Less转换为CSS
|
|
6412
6424
|
],
|
|
6413
6425
|
},
|
|
6414
6426
|
{
|
|
6415
|
-
test: /\.(css
|
|
6416
|
-
include: [/node_modules/, /public/], // 只处理node_modules下的样式文件
|
|
6427
|
+
test: /\.(css)$/,
|
|
6417
6428
|
use: [
|
|
6418
6429
|
mode === 'development'
|
|
6419
6430
|
? require.resolve('style-loader')
|
|
@@ -6436,15 +6447,6 @@ const getCssRules = (mode) => {
|
|
|
6436
6447
|
},
|
|
6437
6448
|
},
|
|
6438
6449
|
},
|
|
6439
|
-
{
|
|
6440
|
-
loader: require.resolve('less-loader'),
|
|
6441
|
-
options: {
|
|
6442
|
-
implementation: require.resolve('less'),
|
|
6443
|
-
lessOptions: {
|
|
6444
|
-
javascriptEnabled: true,
|
|
6445
|
-
},
|
|
6446
|
-
},
|
|
6447
|
-
},
|
|
6448
6450
|
],
|
|
6449
6451
|
},
|
|
6450
6452
|
];
|
|
@@ -6462,6 +6464,7 @@ const OMIT_NAMES_ALL = [
|
|
|
6462
6464
|
'define',
|
|
6463
6465
|
'setting',
|
|
6464
6466
|
'vue',
|
|
6467
|
+
'library',
|
|
6465
6468
|
];
|
|
6466
6469
|
const hasIndex = (routes, mpa) => {
|
|
6467
6470
|
if (isEmpty$2(routes) || isEmpty$2(mpa))
|
|
@@ -48737,7 +48740,7 @@ const createCwdConfig = (cwd, name, vue) => {
|
|
|
48737
48740
|
};
|
|
48738
48741
|
|
|
48739
48742
|
var name = "gant-core";
|
|
48740
|
-
var version = "0.1.
|
|
48743
|
+
var version = "0.1.37";
|
|
48741
48744
|
var description = "";
|
|
48742
48745
|
var main = "lib/index.js";
|
|
48743
48746
|
var bin = {
|
|
@@ -48774,6 +48777,7 @@ var devDependencies = {
|
|
|
48774
48777
|
"rollup-plugin-copy": "^3.5.0",
|
|
48775
48778
|
"rollup-plugin-dts": "^6.1.0",
|
|
48776
48779
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
48780
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
48777
48781
|
tmp: "^0.2.3",
|
|
48778
48782
|
typescript: "^5.3.3",
|
|
48779
48783
|
url: "^0.11.3"
|