Skip to content

Instantly share code, notes, and snippets.

@movii
Last active June 19, 2018 02:20
Show Gist options
  • Save movii/a507c95455617e6cc8b74ae878f9a928 to your computer and use it in GitHub Desktop.
Save movii/a507c95455617e6cc8b74ae878f9a928 to your computer and use it in GitHub Desktop.
配合 Vue.js 配置 Webpack。原文:https://moxo.io/blog/2016/09/10/npm-vue-webpack/
/* ... */
+ let webpack = require('webpack')
module.exports = {
/* ... */
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
+ publicPath: 'http://localhost:1333/dist/'
},
/* ... */
devServer: {
publicPath: '/dist/',
contentBase: './',
compress: true,
port: 1333,
+ hot: true,
+ hotOnly: true
},
plugins: [
new VueLoaderPlugin()
+ new webpack.NamedModulesPlugin(),
+ new webpack.HotModuleReplacementPlugin()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment