-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.build.js
45 lines (42 loc) · 906 Bytes
/
webpack.build.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
const path = require('path');
const autoprefixer = require('autoprefixer');
const config = {
context: __dirname,
entry: {
dragresize: './src/Dragresize.jsx',
},
output: {
path: path.resolve(__dirname, './dist'),
libraryTarget: 'umd',
filename: '[name].js',
},
resolve: {
root: [
path.join(__dirname, '/src'),
],
extensions: ['', '.js', '.jsx'],
},
module: {
noParse: [],
loaders: [
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ },
{
test: /\.less|\.css$/,
loader: 'style!css?modules&localIdentName=[local]__[hash:base64:10]!postcss!less',
},
],
},
postcss: () => {
return [autoprefixer];
},
externals: {
react: {
root: 'React',
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
},
},
devtool: 'source-map',
};
module.exports = config;