Browse Source

KERNEL-14316 chore:打包调整

es6
Treecat 2 years ago
parent
commit
9fffb7bac5
  1. 8
      packages/fineui/webpack/webpack.common.js
  2. 34
      packages/fineui/webpack/webpack.dev.js
  3. 7
      packages/fineui/webpack/webpack.prod.js

8
packages/fineui/webpack/webpack.common.js

@ -4,6 +4,7 @@ const path = require("path");
const fs = require("fs");
const dirs = require("./dirs");
const attachments = require("./attachments");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
let lessVariables = {};
if (process.env.LESS_CONFIG_PATH) {
@ -86,4 +87,11 @@ module.exports = {
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
new ForkTsCheckerWebpackPlugin({}),
],
};

34
packages/fineui/webpack/webpack.dev.js

@ -0,0 +1,34 @@
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const common = require("./webpack.common.js");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const childProcess = require("child_process");
const { merge } = require("webpack-merge");
const dirs = require("./dirs");
const attachments = require("./attachments");
const path = require("path");
function git(command) {
return childProcess.execSync(`git ${command}`).toString().trim();
}
module.exports = merge(common, {
mode: "development",
devtool: "inline-source-map",
output: {
path: dirs.DEST,
filename: "[name].js",
},
devServer: {
port: 9001,
liveReload: true,
historyApiFallback: {
rewrites: [{ from: /.*/, to: "/index.html" }],
},
},
});

7
packages/fineui/webpack/webpack.prod.js

@ -51,10 +51,5 @@ module.exports = merge(common, {
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
new ForkTsCheckerWebpackPlugin({}),
],
});

Loading…
Cancel
Save