gant-core 0.1.35 → 0.1.36

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 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: /\.(css|less)$/,
6371
- exclude: [/node_modules/, /public/],
6383
+ test: /\.(less)$/,
6384
+ exclude: /node_modules|public/,
6372
6385
  use: [
6373
6386
  mode === 'development'
6374
6387
  ? require.resolve('style-loader')
@@ -6408,12 +6421,11 @@ const getCssRules = (mode) => {
6408
6421
  },
6409
6422
  },
6410
6423
  },
6411
- // 将Less转换为CSS
6412
6424
  ],
6413
6425
  },
6414
6426
  {
6415
- test: /\.(css|less)$/,
6416
- include: [/node_modules/, /public/], // 只处理node_modules下的样式文件
6427
+ test: /\.(css)$/,
6428
+ include: /node_modules|public/, // 只处理node_modules下的样式文件
6417
6429
  use: [
6418
6430
  mode === 'development'
6419
6431
  ? require.resolve('style-loader')
@@ -6436,15 +6448,6 @@ const getCssRules = (mode) => {
6436
6448
  },
6437
6449
  },
6438
6450
  },
6439
- {
6440
- loader: require.resolve('less-loader'),
6441
- options: {
6442
- implementation: require.resolve('less'),
6443
- lessOptions: {
6444
- javascriptEnabled: true,
6445
- },
6446
- },
6447
- },
6448
6451
  ],
6449
6452
  },
6450
6453
  ];
@@ -6462,6 +6465,7 @@ const OMIT_NAMES_ALL = [
6462
6465
  'define',
6463
6466
  'setting',
6464
6467
  'vue',
6468
+ 'library',
6465
6469
  ];
6466
6470
  const hasIndex = (routes, mpa) => {
6467
6471
  if (isEmpty$2(routes) || isEmpty$2(mpa))
@@ -48737,7 +48741,7 @@ const createCwdConfig = (cwd, name, vue) => {
48737
48741
  };
48738
48742
 
48739
48743
  var name = "gant-core";
48740
- var version = "0.1.35";
48744
+ var version = "0.1.36";
48741
48745
  var description = "";
48742
48746
  var main = "lib/index.js";
48743
48747
  var bin = {
@@ -48774,6 +48778,7 @@ var devDependencies = {
48774
48778
  "rollup-plugin-copy": "^3.5.0",
48775
48779
  "rollup-plugin-dts": "^6.1.0",
48776
48780
  "rollup-plugin-typescript2": "^0.36.0",
48781
+ "terser-webpack-plugin": "^5.3.10",
48777
48782
  tmp: "^0.2.3",
48778
48783
  typescript: "^5.3.3",
48779
48784
  url: "^0.11.3"