-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
56 lines (50 loc) · 1.22 KB
/
config-overrides.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
const path = require('path')
const SpritePlugin = require('svg-sprite-loader/plugin');
module.exports = {
webpack: function(config, env) {
const src = path.join(path.resolve(__dirname, '.'), '/src/')
config.module.rules.push({
// JavaScript / JSON
test : /\.(js|jsx|ts|tsx)$/,
include : [
src,
],
exclude: /src\/assets/,
use : [{
loader : 'babel-loader',
options : {
babelrc : false,
cacheDirectory : true,
presets: [
'@babel/preset-env',
'@babel/preset-react',
'@babel/preset-typescript'
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator'
],
ignore: [
'node_modules',
'src/assets/*'
]
}
}]
})
config.module.rules.push({
test: /\.svg$/,
use: [{
loader: 'svg-sprite-loader',
options: {
extract: true,
spriteFilename: 'sprite.svg',
publicPath: '../public/'
}
}]
})
config.plugins.push(
new SpritePlugin()
)
return config;
}
}