-
Notifications
You must be signed in to change notification settings - Fork 225
/
craco.config.js
45 lines (43 loc) · 1.34 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
45
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
const CracoLessPlugin = require("craco-less");
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const CracoAlias = require('craco-alias');
const dotenv = require('dotenv');
const webpack = require('webpack');
const env = dotenv.config().parsed;
const envKeys = Object.keys(env).reduce((prev, next) => {
prev[`process.env.${next}`] = JSON.stringify(env[next]);
return prev;
}, {});
module.exports = {
webpack: {
plugins: [
new webpack.DefinePlugin(envKeys),
new CaseSensitivePathsPlugin(),
new MonacoWebpackPlugin({
languages: ['yaml'],
customLanguages: [
{
label: 'yaml',
entry: 'monaco-yaml',
worker: {
id: 'monaco-yaml/yamlWorker',
entry: 'monaco-yaml/yaml.worker'
}
}
]
})
]
},
plugins: [
{ plugin: CracoLessPlugin },
{
plugin: CracoAlias,
options: {
source: 'tsconfig',
baseUrl: './src',
tsConfigPath: './tsconfig.json'
}
}
]
};