Skip to content

Instantly share code, notes, and snippets.

@marceloch2
Last active April 28, 2017 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marceloch2/1af211541736d9204dea23d2d0ebe739 to your computer and use it in GitHub Desktop.
Save marceloch2/1af211541736d9204dea23d2d0ebe739 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
module.exports = {
entry: {
'babel-polyfill' : 'babel-polyfill',
app : './resources/assets/js/app.js',
vendor: ["vue", "vue-resource", "vue-strap", "lodash", "moment", "vue-lazyload"],
},
output : {
filename : "public/js/[name].js",
},
plugins : [
new webpack.optimize.CommonsChunkPlugin( {
names : ['vendor'],
filename : 'public/js/vendor.js',
minChunks : Infinity
})
],
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
devtool: '#eval'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment