You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.9 KiB
47 lines
1.9 KiB
const webpack = require('webpack')
|
|
module.exports = {
|
|
/* 部署生产环境和开发环境下的URL:可对当前环境进行区分,baseUrl 从 Vue CLI 3.3 起已弃用,要使用publicPath */
|
|
// baseUrl: process.env.NODE_ENV === 'production' ? './' : '/',
|
|
publicPath: './',
|
|
/* 输出文件目录:在npm run build时,生成文件的目录名称 */
|
|
outputDir: 'dist',
|
|
/* 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录 */
|
|
assetsDir: "assets",
|
|
/* 是否在构建生产包时生成 sourceMap 文件,false将提高构建速度 */
|
|
productionSourceMap: false,
|
|
/* 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存,你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) */
|
|
filenameHashing: true,
|
|
css: {
|
|
// 是否使用css分离插件 ExtractTextPlugin
|
|
extract: false,
|
|
// 开启 CSS source maps?
|
|
// sourceMap: false,
|
|
// css预设器配置项
|
|
// loaderOptions: {},
|
|
// 启用 CSS modules for all css / pre-processor files.
|
|
// modules: false
|
|
},
|
|
/* 代码保存时进行eslint检测 */
|
|
lintOnSave: true,
|
|
//兼容ES6
|
|
// configureWebpack: config => {
|
|
// config.entry.app = ['babel-polyfill','./src/main.ts'];
|
|
// },
|
|
pwa: {
|
|
iconPaths: {
|
|
favicon32 : 'favicon.ico',
|
|
favicon16 : 'favicon.ico',
|
|
appleTouchIcon: 'favicon.ico',
|
|
maskIcon : 'favicon.ico',
|
|
msTileImage : 'favicon.ico'
|
|
}
|
|
},
|
|
transpileDependencies: ['webpack-dev-server/client'],
|
|
devServer: {
|
|
/* 自动打开浏览器 */
|
|
open: true,
|
|
/* 设置为0.0.0.0则所有的地址均能访问 */
|
|
host: '0.0.0.0',
|
|
port: 8080,
|
|
}
|
|
}
|