-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (48 loc) · 1.1 KB
/
Copy pathwebpack.config.js
File metadata and controls
50 lines (48 loc) · 1.1 KB
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
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var node_modules_dir = path.resolve(__dirname, 'node_modules');
var config = {
entry: {
app: path.resolve(__dirname, 'src/main.jsx')
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'react-datatable.js',
library: 'RUC',
libraryTarget: 'umd'
},
externals: {
react: {
root: 'React',
commonjs: 'react',
commonjs2: 'react',
amd: 'react'
},
'fixed-data-table': {
root: 'FixedDataTable',
commonjs: 'fixed-data-table',
commonjs2: 'fixed-data-table',
amd: 'fixedDataTable'
}
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: [node_modules_dir],
loader: 'babel' // "babel" is short for "babel-loader"
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
},{
test: /\.(png|gif|svg)$/,
loader: 'url-loader?limit=100000'
}]
},
plugins: [
new ExtractTextPlugin("react-datatable.css")
]
};
module.exports = config;