You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.3 KiB
67 lines
1.3 KiB
var path = require('path')
|
|
var webpack = require('webpack')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
example: './src/example.js',
|
|
},
|
|
|
|
output: {
|
|
path: './dist',
|
|
publicPath: '/dist/',
|
|
filename: "[name].js",
|
|
},
|
|
|
|
resolveLoader: {
|
|
root: path.join(__dirname, 'node_modules'),
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue'
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel',
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
test: /\.json$/,
|
|
loader: 'json'
|
|
},
|
|
{
|
|
test: /\.html$/,
|
|
loader: 'vue-html'
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif|svg)$/,
|
|
loader: 'url',
|
|
query: {
|
|
limit: 10000,
|
|
name: '[name].[ext]?[hash]'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
devServer: {
|
|
historyApiFallback: true,
|
|
noInfo: true
|
|
},
|
|
devtool: '#eval-source-map'
|
|
}
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
module.exports.devtool = '#source-map'
|
|
// http://vuejs.github.io/vue-loader/workflow/production.html
|
|
module.exports.plugins = (module.exports.plugins || []).concat([
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
NODE_ENV: '"production"'
|
|
}
|
|
}),
|
|
|
|
new webpack.optimize.OccurenceOrderPlugin()
|
|
])
|
|
}
|