Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6eaf21

Browse files
committed
cleanup config overrides
1 parent457cdc6 commite6eaf21

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

‎web-app/config-overrides.js

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
constpath=require('path')// eslint-disable-line
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
constpath=require('path')
3+
const{ addBabelPreset, addBabelPlugin, addWebpackModuleRule}=require('customize-cra')
24

35
module.exports=functionoverride(config){
4-
config.module.rules.push({
6+
addWebpackModuleRule({
57
test:/\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
68
use:[
79
{
@@ -12,34 +14,19 @@ module.exports = function override(config) {
1214
},
1315
},
1416
],
15-
})
17+
})(config)
1618

17-
config.module.rules.push({
18-
test:/\.(ts|tsx)$/,
19-
loader:require.resolve('babel-loader'),
20-
options:{
21-
plugins:[
22-
// load css for@alifd/next components
23-
[
24-
'babel-plugin-import',
25-
{
26-
libraryName:'@alifd/next',
27-
style:true,
28-
},
29-
],
30-
],
31-
presets:[
32-
// react-app
33-
['react-app',{flow:false,typescript:true}],
34-
// allow emotion css prop on html
35-
['@emotion/babel-preset-css-prop'],
36-
],
19+
// load@alifd/next component css
20+
addBabelPlugin([
21+
'babel-plugin-import',
22+
{
23+
libraryName:'@alifd/next',
24+
style:true,
3725
},
38-
})
26+
])(config)
3927

40-
config.resolve.extensions.push('.ts','.tsx')
41-
42-
config.resolve.modules=['node_modules',path.resolve(__dirname,'./src')]
28+
// setup emotion styles
29+
addBabelPreset('@emotion/babel-preset-css-prop')(config)
4330

4431
returnconfig
4532
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp