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.
83 lines
1.5 KiB
83 lines
1.5 KiB
var path = require('path')
|
|
var webpack = require('webpack')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
example: ['./example'],
|
|
},
|
|
|
|
output: {
|
|
path: './dist',
|
|
publicPath: '/dist/',
|
|
filename: "[name].js",
|
|
// target: 'node',
|
|
},
|
|
|
|
|
|
resolve: {
|
|
root: path.join(__dirname, 'node_modules'),
|
|
extensions: ['', '.js', '.vue', '.json'],
|
|
},
|
|
|
|
externals: {
|
|
vue: 'Vue',
|
|
vuex: 'Vuex',
|
|
},
|
|
|
|
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]'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
babel: {
|
|
presets: ['es2015', 'stage-0'],
|
|
plugins: ['transform-runtime'],
|
|
},
|
|
|
|
devServer: {
|
|
// host: '172.16.23.1',
|
|
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()
|
|
])
|
|
}
|