forked from GoldenChrysus/ffxiv-ember-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
41 lines (37 loc) · 948 Bytes
/
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
const { getLoader, loaderByName, throwUnexpectedConfigError } = require('@craco/craco')
module.exports = {
webpack: {
alias: {
'../../theme.config$': require('path').join(__dirname, '/src/semantic-ui/theme.config'),
},
},
plugins: [
{
plugin : require('craco-less'),
options : {
lessLoaderOptions : {
javascriptEnabled : true
}
}
},
{
plugin: {
overrideWebpackConfig: ({ context, webpackConfig }) => {
const { isFound, match: fileLoaderMatch } = getLoader(
webpackConfig,
loaderByName('file-loader'),
)
if (!isFound) {
throwUnexpectedConfigError({
message: `Can't find file-loader in the ${context.env} webpack config!`,
})
}
fileLoaderMatch.loader.exclude.push(/theme.config$/)
fileLoaderMatch.loader.exclude.push(/\.variables$/)
fileLoaderMatch.loader.exclude.push(/\.overrides$/)
return webpackConfig
},
},
},
],
}