Vue CLI4.0 webpack配置属性——outputDir、assetsDir、indexPath
outputDirType: stringDefault: dist作用:设置项目打包生成的文件的存储目录,可以是静态路径也可以是相对路径。注意:相对路径是相对于项目文件当前的根路径。写法:module.exports = {publicPath: './', // 基本路径outputDir: 'dist', // 输出文件目录}...
·
outputDir
- Type:
string
- Default:
dist
作用:
设置项目打包生成的文件的存储目录,可以是静态路径也可以是相对路径。
注意:相对路径是相对于项目文件当前的根路径。
用法:
module.exports = {
publicPath: './', // 基本路径
outputDir: 'dist', // 输出文件目录
}
assetsDir
- Type:
string
- Default:
''
作用:
设置放置打包生成的静态资源 (js、css、img、fonts) 的目录。
注意: 该目录是相对于 outputDir
。
用法:
module.exports = {
publicPath: './', // 基本路径
outputDir: 'dist', // 输出文件目录
assetsDir: 'assets'
}
indexPath
- Type:
string
- Default:
'index.html'
用途
用于设定打包生成的 index.html
文件的存储位置
注意:
- 该路径若是相对路径,则相对于
outputDir
;当然,也可以是一个绝对路径; - 路径一定要以
文件名+后缀
结尾,最好以index,html
结尾。
用法:
module.exports = {
publicPath: './', // 基本路径
outputDir: 'dist', // 输出文件目录W
assetsDir: './assets',
indexPath: 'index.html'
}
文章跳转
更多推荐
已为社区贡献5条内容
所有评论(0)