102 Star 1.2K Fork 363

华哲辰/魔方栈

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
华哲辰 提交于 2021-07-19 22:50 . webpack config eslint disable
/* eslint-disable */
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = (env, argv) => ({
entry: {
index: "./src/index.ts",
},
devtool: argv.mode === "production" ? false : "eval-cheap-module-source-map",
output: {
path: path.resolve(__dirname, "./dist"),
filename: "[name].[chunkhash].js",
globalObject: "this",
},
module: {
rules: [
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.tsx?$/,
loader: "ts-loader",
},
{
test: /\.(html|svg)?$/,
loader: "text-loader",
},
{
test: /.(png|woff(2)?|eot|ttf)(\?[a-z0-9=\.]+)?$/,
type: "asset/inline",
},
],
},
resolve: {
alias: {
vue$: "vue/dist/vue.esm.js",
},
extensions: ["*", ".js", ".ts", ".json"],
},
performance: {
hints: false,
},
optimization: {
minimize: argv.mode === "production",
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
parallel: true,
}),
],
splitChunks: {
chunks: "initial",
name: "vendor",
},
},
plugins: [
new HtmlWebpackPlugin({
favicon: "./resource/icon.png",
filename: "index.html",
template: "./resource/index.html",
}),
new CleanWebpackPlugin({
dry: argv.mode !== "production",
}),
],
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/huazhechen/cuber.git
[email protected]:huazhechen/cuber.git
huazhechen
cuber
魔方栈
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385