-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.build.js
More file actions
50 lines (48 loc) · 1.33 KB
/
webpack.config.build.js
File metadata and controls
50 lines (48 loc) · 1.33 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
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin');
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './lib'),
filename: 'Drawer.js',
library: 'React-Drawer',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.(less|css)?$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [{
loader: 'css-loader'
}, {
loader: 'postcss-loader'
}, {
loader: 'less-loader'
}]
})
}, {
test: /\.(svg|ttf|eot|svg|woff(\(?2\)?)?)(\?[a-zA-Z_0-9.=&]*)?(#[a-zA-Z_0-9.=&]*)?$/,
use: "file-loader?name=./fonts/[name].[ext]"
}]
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: false
}),
new ExtractTextPlugin({
filename: "Drawer.css",
disable: false,
allChunks: true
})
]
}