Files
vue-chartjs/build/webpack.prod.conf.js
Jakub Juszczak c0254c9521 Add umd module gereation for npm package
Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2016-07-27 21:35:56 +02:00

33 lines
734 B
JavaScript

const webpack = require('webpack')
const base = require('./webpack.base.conf')
const config = require('../config')
base.entry = {
lib: './src/index.js'
}
base.output = {
path: config.build.assetsRoot,
publicPath: config.build.assetsPublicPath,
filename: 'vue-chartjs.js',
library: 'VueChartJs',
libraryTarget: 'umd'
}
var webpackConfig = Object.assign({}, base)
webpackConfig.devtool = '#source-map'
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new webpack.optimize.OccurenceOrderPlugin(),
])
module.exports = webpackConfig