【发布时间】:2020-08-22 12:16:24
【问题描述】:
我尝试从产品构建中排除 Html 文件“dev.html”。我必须如何配置 webpack? 我知道我必须应用规则,但在哪里?这是我的 vue.config.js
module.exports = {
"transpileDependencies": [
"vuetify"
],
pages: {
index: {
// entry for the page
entry: 'src/main.ts',
// the source template
template: process.env.NODE_ENV === 'development' ?
'public/dev.html' :
'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Index Page',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
},
configureWebpack: {
devtool: process.env.NODE_ENV === 'development' ? 'source-map' : 'none',
}
}
【问题讨论】:
标签: javascript vue.js web webpack webpack-4