-
Notifications
You must be signed in to change notification settings - Fork 50
/
webpack.config.js
51 lines (50 loc) · 1.01 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
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
optimization: {
nodeEnv: false,
usedExports: true,
},
entry: {
main: './index.js',
'text-input': './components/text-input/index.js',
'share-dialog': './components/share-dialog/index.js',
icons12: './components/icons/12px/index.js',
icons18: './components/icons/18px/index.js',
},
devtool: 'sourcemap',
output: {
filename: '[name].js',
path: path.resolve('./dist'),
libraryTarget: 'commonjs2',
jsonpFunction: 'styledUIJsonp',
},
externals: [nodeExternals()],
plugins: [],
module: {
rules: [
{
test: /\.jsx?$/,
use: 'babel-loader',
exclude: [/node_modules/],
},
{
test: /\.(svg)$/,
use: [
{
loader: '@svgr/webpack',
options: {
replaceAttrValues: {
'#7A7A7A': '{props.color || "#7A7A7A"}',
'#888': '{props.color || "#7A7A7A"}',
},
},
},
],
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
};