9 Star 39 Fork 18

leearmy/连锁门诊系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 2.72 KB
一键复制 编辑 原始数据 按行查看 历史
sudawuyejituan 提交于 2023-02-21 11:01 . 初始化版本
const easyProjectScp = require("easy-project-scp");
const path = require("path");
const HappyPack = require("happypack");
const os = require("os");
const happyThread = HappyPack.ThreadPool({ size: os.cpus().length });
const speedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new speedMeasurePlugin();
module.exports = {
publicPath: "/",
parallel: false,
css: {
modules: false,
loaderOptions: {
//全局变量
sass: {
data: `@import "@/_css/config.scss";`
}
}
},
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
"@utils": path.join(__dirname, "./src/utils"),
"@mixins": path.join(__dirname, "./src/mixins"),
"@components": path.join(__dirname, "./src/components")
}
},
plugins: smp.wrap([
new easyProjectScp.WebpackPlugin(),
new HappyPack({
id: "js",
loaders: [
{ loader: "babel-loader", query: "?presets[]=es2015" },
{ loader: "thread-loader", option: { Worker: 2 } }
],
threadPool: happyThread,
verbose: true
}),
new HappyPack({ id: "styles", loaders: [{ loader: "thread-loader", option: { Worker: 2 } }], threadPool: happyThread, loaders: ["sass-loader"] })
]),
externals: {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
axios: "axios",
qs: "Qs"
}
},
// configureWebpack: (config) => {
// // config.devtools = process.env.NODE_ENV === 'development'
// if (process.env.NODE_ENV === "production") {
// config.plugins.push(new easyProjectScp.WebpackPlugin());
// config.plugins.push(
// new HappyPack({
// id: "js",
// loaders: [
// {
// loader: "babel-loader",
// query: "?presets[]=es2015",
// },
// ],
// threadPool: happyThread,
// verbose: true,
// })
// );
// config.plugins.push(
// new HappyPack({
// id: "styles",
// threadPool: happyThread,
// loaders: ["sass-loader"],
// })
// );
// // 生产环境
// // config.plugins.push(
// // new CompressionWebpackPlugin({
// // asset: "[path].gz[query]",
// // algorithm: "gzip",
// // test: new RegExp("\\.(" + productionGzipExtensions.join("|") + ")$"),
// // threshold: 10240,
// // minRatio: 0.8
// // })
// // );
// } else {
// // 开发环境
// }
// config["externals"] = {
// vue: "Vue",
// vuex: "Vuex",
// "vue-router": "VueRouter",
// axios: "axios",
// qs: "Qs",
// };
// },
chainWebpack: config => {}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/leearmy/his.git
[email protected]:leearmy/his.git
leearmy
his
连锁门诊系统
master

搜索帮助