forked from schiehll/react-alert
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
67 lines (60 loc) · 1.42 KB
/
webpack.config.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
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer-core');
var webpackUMDExternal = require('webpack-umd-external');
var paths = {
public: '/dist',
dist: path.resolve(__dirname, 'dist'),
js: {
index: path.resolve(__dirname, './index.js'),
dev: path.resolve(__dirname, './dev')
},
styles: path.resolve(__dirname, './dev/assets/styles'),
images: path.resolve(__dirname, './dev/assets/img'),
modules: path.resolve(__dirname, './node_modules')
}
module.exports = {
entry: {
alert: [
paths.js.index
]
},
output: {
path: paths.dist,
filename: '[name].js',
publicPath: paths.public,
devtoolModuleFilenameTemplate: '../[resource-path]',
libraryTarget: 'umd',
library: 'react-alert'
},
postcss: function(){
return [autoprefixer]
},
module: {
loaders: [
{
test: /\.js$/,
include: [paths.js.index, paths.js.dev],
loader: 'babel'
},
{
test: /\.css$/,
include: paths.styles,
loader: 'style!css'
},
{
test: /\.(jpg|png|gif)$/,
include: paths.images,
loader: 'url?limit=80000'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.css']
},
externals: webpackUMDExternal({
'react': 'react',
'react-dom': 'react-dom',
'react-addons-css-transition-group': 'react-addons-css-transition-group'
})
};