UNPKG

1.37 kBJavaScriptView Raw
1var path = require('path');
2var webpack = require('webpack');
3var ExtractTextPlugin = require('extract-text-webpack-plugin');
4
5var plugins = [
6 // new ExtractTextPlugin('bundle.css', { allChunks: true }),
7 new webpack.IgnorePlugin(/^(buffertools)$/), // unwanted "deeper" dependency
8 new webpack.NoErrorsPlugin(),
9 new webpack.optimize.OccurenceOrderPlugin(),
10 new webpack.DefinePlugin({
11 'process.env': {
12 'NODE_ENV': JSON.stringify('production')
13 }
14 }),
15 new webpack.optimize.UglifyJsPlugin({
16 compressor: {
17 screw_ie8: true,
18 warnings: false
19 }
20 })
21]
22
23module.exports = {
24 devtool: 'cheap-source-map',
25 resolve: {
26 extensions: ['', '.js']
27 },
28 entry: [ './src/index' ],
29 output: {
30 filename: 'bundle.js',
31 path: path.join(__dirname, 'dist'),
32 libraryTarget: 'umd',
33 library: 'BluprintConfigBuilder'
34 },
35 externals: {
36 react: {
37 root: 'React',
38 commonjs2: 'react',
39 commonjs: 'react',
40 amd: 'react'
41 }
42 },
43 plugins: plugins,
44 module: {
45 loaders: [
46 {
47 test: /\.js$/,
48 loaders: ['babel-loader'],
49 include: /src/
50 },
51 {
52 test: /\.css$/,
53 loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader',
54 exclude: /node_modules/
55 }
56 ]
57 }
58};