LoginSignup
2

More than 5 years have passed since last update.

vue init webpack-simple からの最低限の設定

Posted at

人に依って何が最低限か違うが・・・

vue init webpack-simple some-project で環境ができる。ただ公開するには追加の設定が必要なので書いておく

html-webpack-plugin

ビルド後、自動的にバージョニングしたJSファイルを追加してくれる

yarn add -D html-webpack-plugin

webpack.config.jsの設定

webpack.config.js
var HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  // ...

  plugins: [
    new HtmlWebpackPlugin({filename: 'assets/admin.html'})
  ]
}

if (process.env.NODE_ENV === 'production') {
  // ...
  module.exports.output.filename = 'build.[hash].js'
}

他にもあったら追加していく

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2