-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.build.js
More file actions
34 lines (27 loc) · 959 Bytes
/
webpack.build.js
File metadata and controls
34 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'index.js',
path: 'lib',
library: 'ReactRaml',
libraryTarget: 'umd'
},
module: {
loaders: [
{ test: /\.jsx?$/, loader: 'babel', exclude: /node_modules/ },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?module&localIdentName=[name]__[local]&importLoaders=1!postcss-loader'), exclude: /node_modules/ },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader?pack=nodeModules'), include: /node_modules/ }
]
},
externals: { react: 'react', 'react/addons': 'react' },
plugins: [
new ExtractTextPlugin('styles.css', { allChunks: true }),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
]
};