2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-05-26 12:24:06 +03:00
Files
vue-native-websocket/webpack.config.js
T
Metin Seylan 7f5fac27d0 v2
2016-10-29 00:47:04 +03:00

51 lines
1.2 KiB
JavaScript

var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: ['./src/Main.js'],
output: {
path: path.resolve(__dirname, './dist'),
filename: 'build.js',
library: ['VueSocketio'],
libraryTarget: 'umd'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
},
{
test: /\.json$/,
loader: 'json'
}
]
},
devtool: 'eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = 'source-map'
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
])
}