-
Notifications
You must be signed in to change notification settings - Fork 5
/
config-overrides.js
52 lines (46 loc) · 1.63 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
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const includeMonacoWebpackPlugin = (config) => {
// const {rules} = config.module;
// const monacoWebpackPluginModuleRules = [
// // { // CRA does it : const oneOfRules = rules.find(rule=>rule?.oneOf); // style-loader css rules
// // test: /\.css$/,
// // use: ['style-loader', 'css-loader']
// // },
// // {
// // test: /\.ttf$/, // const excludeRule = newOneOfRules.pop(); {
// //// exclude: [ /^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/ ],
// //// type: 'asset/resource'
// //// }
// // type: 'asset/resource'
// // },
// ];
// config.module.rules[1].oneOf = newOneOfRules;
// setTimeout(() => {
// console.log("r", config, "rules", config.module.rules, "rules oneOf", config.module.rules[1].oneOf);
// }, 10000);
config.plugins = [
...config.plugins,
new MonacoWebpackPlugin(
{
languages: [
'html', 'handlebars',
'css', 'less', 'scss',
'typescript', 'javascript',
'json', 'xml',
],
globalAPI: true,
}
)
];
};
module.exports = (config, /*, env*/) => {
includeMonacoWebpackPlugin(config);
// add fallback for vm module
config.resolve.fallback = {
...config.resolve.fallback,
"path": require.resolve("vm-browserify"),
"vm": require.resolve("vm-browserify"),
"fs": false,
};
return config;
};