Ai
1 Star 0 Fork 0

WallE/vue-multiple

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
WallE 提交于 2021-03-18 10:11 +08:00 . add
// let env = process.env.NODE_ENV;
// let FILE_NAME = process.env.FILE_NAME
console.log('----------------');
console.log(process.env.FILE_NAME);
const curName = process.env.FILE_NAME
const entry = `src/${curName}/main.js`
const template = `src/${curName}/public/${curName}.html`
console.log(entry);
console.log(template);
// npm i compression-webpack-plugin -D
// const CompressionWebpackPlugin = require("compression-webpack-plugin");
module.exports = {
// 如果是hash模式
// publicPath: env === 'production' ? './' : `/${FILE_NAME}`,
publicPath: './',
// 如果是history模式
// publicPath: env === 'production' ? '/' : '/',
pages: {
[curName]: {
entry: entry,
// template: `src/public/${curName}.html`,
favicon: `src/${curName}/public/favicon.ico`,
template: template,
filename: 'index.html',
title: 'Index Page',
chunks: ['chunk-vendors', 'chunk-common', curName]
}
// subpage:'src/views/home/main.js'
},
filenameHashing: true,
productionSourceMap: false,
// 输出文件目录默认'dist
// outputDir: "dist",
outputDir: `dist/${curName}`,
runtimeCompiler: true,
// 静态资源目录 (js, css, img, fonts)
assetsDir: "assets",
//设置打包之后是否打包.map文件
// productionSourceMap: env !== "development" ? false : true,
// 所有 webpack-dev-server 的选项都支持
devServer: {
port: 8083,
// host: "0.0.0.0",
// hot: true,
// open: false,
// disableHostCheck: true,
// proxy: {
// // axios.defaults.baseURL = '/a
// '/a': {
// target: "http://localhost:3000",
// // ws: true,
// changeOrigin: true,
// pathRewrite: {
// '^/a': ''
// }
// },
// }
// // proxy: "http://localhost:3000",
},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangchangran/vue-multiple.git
git@gitee.com:wangchangran/vue-multiple.git
wangchangran
vue-multiple
vue-multiple
master

搜索帮助