Created
December 3, 2020 11:48
-
-
Save jwchang0206/6e6cbc8f28b53ca4a966bc8cc597350c to your computer and use it in GitHub Desktop.
Revisions
-
jwchang0206 created this gist
Dec 3, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ const CracoSwcPlugin = require('craco-swc'); module.exports = { plugins: [ { plugin: { ...CracoSwcPlugin, overrideCracoConfig: ({ cracoConfig }) => { if (typeof cracoConfig.eslint.enable !== 'undefined') { cracoConfig.disableEslint = !cracoConfig.eslint.enable; } delete cracoConfig.eslint; return cracoConfig; }, overrideWebpackConfig: ({ webpackConfig, cracoConfig }) => { if ( typeof cracoConfig.disableEslint !== 'undefined' && cracoConfig.disableEslint === true ) { webpackConfig.plugins = webpackConfig.plugins.filter( (instance) => instance.constructor.name !== 'ESLintWebpackPlugin', ); } return webpackConfig; }, }, options: { swcLoaderOptions: { jsc: { externalHelpers: true, target: 'es5', parser: { syntax: 'typescript', tsx: true, dynamicImport: true, exportDefaultFrom: true, }, }, }, }, }, ], };