forked from virtyaluk/react-fashion-watch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dist.config.babel.js
68 lines (63 loc) · 1.9 KB
/
dist.config.babel.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* ReactFashionWatch - a carefully crafted Fashion Watch component for React.
* https://github.com/virtyaluk/react-fashion-watch
*
* Copyright (c) 2016 Bohdan Shtepan
* http://modern-dev.com/
*
* Licensed under the MIT license.
*/
import { BannerPlugin } from 'webpack';
import autoprefixer from 'autoprefixer';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
let autoprefixerCfg = { browsers: ['last 3 versions'] },
srcLibName = 'ReactFashionWatch',
distLibName = 'react-fashion-watch',
banner = `ReactFashionWatch - a carefully crafted Fashion Watch component for React.
https://github.com/virtyaluk/react-fashion-watch
Copyright (c) 2016 Bohdan Shtepan
http://modern-dev.com/
Licensed under the MIT license.`;
export default {
entry: `./src/${srcLibName}.jsx`,
output: {
path: __dirname + '/dist',
libraryTarget: 'umd',
library: srcLibName,
filename: distLibName + '.js'
},
devtool: 'source-map',
module: {
loaders: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: 'eslint-loader',
exclude: /(node_modules|bower_components|dist)/
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader')
}
]
},
plugins: [
new ExtractTextPlugin(distLibName + '.css'),
new BannerPlugin(banner)
],
sassLoader: {
outputStyle: 'nested'
},
postcss: () => [autoprefixer(autoprefixerCfg)],
// externals: {
// react: 'React',
// 'react-style-normalizer': 'styleNormalizer'
// },
resolve: {
extensions: ['', '.js', '.jsx', '.scss']
}
};