-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraco.config.js
More file actions
47 lines (46 loc) · 1.33 KB
/
craco.config.js
File metadata and controls
47 lines (46 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
const CracoLessPlugin = require('craco-less');
const CracoAlias = require('craco-alias');
const jestConfig = require('./jest.config.js');
const assign = require('lodash/assign');
const merge = require('lodash/merge');
module.exports = {
jest: {
configure: (config, { env, paths, resolve, rootDir }) => {
return assign(config, jestConfig, {transform: merge(config.transform, jestConfig.transform)});
},
},
plugins: [
{ plugin: CracoLessPlugin },
{
plugin: CracoAlias,
options: {
source: 'tsconfig',
// baseUrl SHOULD be specified
// plugin does not take it from tsconfig
baseUrl: './',
// tsConfigPath should point to the file where "baseUrl" and "paths" are specified
tsConfigPath: './tsconfig.extend.json',
},
},
],
webpack: {
configure: (config, { env, paths }) => {
config.module.rules.push({
test: /\.js$/,
exclude: /node_modules[/\\](?!react-data-grid[/\\]lib)/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
},
},
],
});
return config;
},
},
};