-
Notifications
You must be signed in to change notification settings - Fork 420
/
webpack.config.js
63 lines (61 loc) · 1.28 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
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-env node */
const path = require('path');
const StringReplacePlugin = require('string-replace-webpack-plugin');
const packageJson = require('./package.json');
const config = {
mode: 'development',
entry: {
'design-system-react': ['./components'],
},
resolve: {
extensions: ['.js', '.jsx'],
},
devtool: 'source-map',
output: {
path: path.join(__dirname, '.tmp'),
filename: '[name].js',
publicPath: '/',
},
module: {
rules: [
{
test: /\.jsx?$/,
loaders: [
'babel-loader',
StringReplacePlugin.replace({
replacements: [
{
pattern: /__VERSION__/g,
replacement: () => packageJson.version,
},
],
}),
],
include: [
path.join(__dirname, 'components'),
path.join(__dirname, 'css'),
path.join(__dirname, 'icons'),
path.join(__dirname, 'tests'),
path.join(__dirname, 'utilities'),
],
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
},
{
test: /\.(svg|gif|jpe?g|png)$/,
loader: 'file-loader?limit=10000',
},
{
test: /\.(eot|woff|woff2|ttf)$/,
loader: 'file-loader?limit=30&name=fonts/webfonts/[name].[ext]',
},
],
},
performance: {
hints: false,
},
plugins: [new StringReplacePlugin()],
};
module.exports = config;