加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
刘旭dd 提交于 2020-01-07 18:16 . 全部项目上传
const path = require("path");
const HardSourceWebpackPlugin = require("hard-source-webpack-plugin");
const AutoDllPlugin = require("autodll-webpack-plugin");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
// context: path.resolve(__dirname, '../'),
// entry: { app: './src/main.js' },
// //百度地图配置20180518
// externals: {
// "BMap": "BMap",
// // 添加后搜索定位位置附近固定门店
// // 'BMap_Symbol_SHAPE_POINT': 'BMap_Symbol_SHAPE_POINT'
// },
assetsDir: "h5",
configureWebpack: config => {
Object.assign(config.resolve.alias, {
"@utils": resolve("src/utils"),
"@libs": resolve("src/libs"),
"@api": resolve("src/api"),
"@components": resolve("src/components"),
"@assets": resolve("src/assets"),
"@css": resolve("src/assets/css"),
"@images": resolve("src/assets/images"),
"@views": resolve("src/views"),
"@mixins": resolve("src/mixins")
});
if (process.env.NODE_ENV !== "production") {
config.plugins.push(
new HardSourceWebpackPlugin(),
new AutoDllPlugin({
inject: true,
debug: true,
filename: "[name]_[hash].js",
path: "./dll" + Date.parse(new Date()),
entry: {
vendor_vue: ["vue", "vuex", "vue-router"],
vendor_ui: ["vue-awesome-swiper", "vue-ydui"],
vendor_tools: ["axios", "core-js"]
}
})
);
}
},
chainWebpack: config => {
config.plugin("html").tap(args => {
args[0].VUE_APP_NAME = process.env.VUE_APP_NAME;
return args;
});
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化