-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
38 lines (35 loc) · 1.17 KB
/
config-overrides.js
File metadata and controls
38 lines (35 loc) · 1.17 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
const BabelEnginePlugin = require('babel-engine-plugin');
const resolve = require('path').resolve;
const { injectBabelPlugin } = require('react-app-rewired');
const rewirePreact = require('react-app-rewire-preact');
module.exports = function override(config, env) {
//do stuff with the webpack config...
config = injectBabelPlugin(['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }], config);
//config = rewirePreact(config, env);
config.plugins.push(
new BabelEnginePlugin({
presets: ['env', 'react']
})
);
// config.module.rules.push ({
// test: resolve(__dirname, 'node_modules/js-video-url-parser'),
// loader: "babel-loader",
// options: {
// babelrc: false,
// cacheDirectory: false,
// presets: ["env"],
// plugins: ["syntax-async-functions", "transform-regenerator"]
// }
// })
// config.module.rules.push ({
// test: resolve(__dirname, 'node_modules/ws'),
// loader: "babel-loader",
// options: {
// babelrc: false,
// cacheDirectory: false,
// presets: ["env"],
// plugins: ["syntax-async-functions", "transform-regenerator"]
// }
// })
return config;
}