Skip to content

Instantly share code, notes, and snippets.

@g-patel
Last active February 14, 2017 20:40
Show Gist options
  • Save g-patel/9d039d417018bd7abb8866f6b749a801 to your computer and use it in GitHub Desktop.
Save g-patel/9d039d417018bd7abb8866f6b749a801 to your computer and use it in GitHub Desktop.
var config = require('../config');
var webpack = require('webpack');
var merge = require('webpack-merge');
var utils = require('./utils');
var path = require('path');
var projectRoot = path.resolve(__dirname, '../');
var baseWebpackConfig = require('./webpack.common');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
const ENV = process.env.ENV = process.env.NODE_ENV = 'production';
module.exports = merge(baseWebpackConfig, {
entry: {
app: './src/index.js'
},
externals: {
'lodash': 'lodash',
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.runtime.min',
}
},
module: {
loaders: utils.styleLoaders({ extract: true })
},
output: {
library: 'grpn-wh-components',
libraryTarget: 'umd',
umdNamedDefine: true
},
vue: {
loaders: utils.cssLoaders({
extract: true
})
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new ExtractTextPlugin('../lib/grpn-wh-components.css'),
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment