-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcraco.config.js
44 lines (40 loc) · 1.2 KB
/
craco.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
const path = require('path');
const { whenProd } = require('@craco/craco');
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.path.json');
const sassResourcesLoader = require('craco-sass-resources-loader');
module.exports = {
plugins: [
...whenProd(() => [{ plugin: require('./fontawesome.config') }], []),
{
plugin: require('craco-less'),
options: { lessLoaderOptions: { lessOptions: { javascriptEnabled: true } } },
},
{
plugin: sassResourcesLoader,
options: { resources: ['./src/Assets/scss/base/export.scss'] },
},
],
style: {
postcss: { plugins: [require('tailwindcss'), require('autoprefixer')] },
},
//* Loading absolute paths
webpack: {
alias: {
'@src': path.resolve(__dirname, 'src'),
'@data': path.resolve(__dirname, 'src/Data'),
'@tools': path.resolve(__dirname, 'src/Tools'),
'@assets': path.resolve(__dirname, 'src/Assets'),
'@config': path.resolve(__dirname, 'src/App/Config'),
'@components': path.resolve(__dirname, 'src/Components'),
},
},
jest: {
configure: {
preset: 'ts-jest',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/src/',
}),
},
},
};