Last active
March 15, 2018 14:09
-
-
Save haribote/5dacac20010603d5b8b35a242bc2c3d5 to your computer and use it in GitHub Desktop.
Multi-entry, No-html-injection, No-cache-buster - A custom configuration fro vue-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vue.config.js | |
module.exports = { | |
chainWebpack: config => { | |
// 全てのエントリーポイントを一旦クリア | |
config.entryPoints | |
.clear() | |
// あらためてエントリーポイントを設定 | |
config | |
.entry('app') | |
.add('./src/app.ts') | |
config | |
.entry('common') | |
.add('./src/common.ts') | |
// HtmlWebpackPlugin を無効化する | |
config.plugins.delete('html') | |
// プロダクションビルド時にキャッシュバスターを付与させない | |
if (process.env.NODE_ENV === 'production') { | |
config.output | |
.filename('[name].bundle.js') | |
config | |
.plugin('extract-css') | |
.tap(_ => [ | |
{ | |
filename: 'css/[name].css', | |
allChunks: true | |
} | |
]) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment