-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.production.js
41 lines (39 loc) · 1.17 KB
/
webpack.config.production.js
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
35
36
37
38
39
40
41
const pkg = require('./package');
const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/index.js',
devtool: 'inline-source-map',
output: {
path: path.join(__dirname, '/lib'),
libraryTarget: 'umd',
library: 'arctype',
filename: 'index.js'
},
resolve: {
extensions: ['', '.scss', '.jsx', '.js']
},
postcss: [autoprefixer],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel'
},
{
test: /\.(scss|css)$/,
loader: 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap'
}
]
},
plugins: [
// new ExtractTextPlugin('bundle.css', {allChunks: true}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
VERSION: JSON.stringify(pkg.version)
})
]
};