forked from frontend-collective/react-image-lightbox
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.umd.babel.js
48 lines (47 loc) · 1.25 KB
/
webpack.config.umd.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
import path from 'path';
import webpack from 'webpack';
import autoprefixer from 'autoprefixer';
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
'react-image-lightbox': './src/index',
},
output: {
path: path.join(__dirname, 'dist', 'umd'),
filename: '[name].js',
libraryTarget: 'umd',
library: 'ReactImageLightbox',
},
resolve: {
extensions: ['', '.js']
},
devtool: 'source-map',
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new ExtractTextPlugin('bundle.min.css'),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
}),
],
externals: {
react: 'react',
'react-dom': 'react-dom',
'react-modal': 'react-modal',
},
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css-loader','sass-loader'),
include: path.join(__dirname, 'src')
},
]
}
};