Created
May 4, 2020 20:52
-
-
Save annacoding2020/5e82bbc1150cfaa9dd0d239a1d5464c7 to your computer and use it in GitHub Desktop.
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 characters
| const path = require('path'); | |
| const { override, fixBabelImports, addLessLoader } = require('customize-cra') | |
| const FilterWarningsPlugin = require('webpack-filter-warnings-plugin') | |
| // filter out warning to prevent CI build failing | |
| const filterWarningsPlugin = config => { | |
| config.plugins.push( | |
| new FilterWarningsPlugin({ | |
| exclude: /mini-css-extract-plugin/ | |
| }) | |
| ) | |
| return config | |
| } | |
| // const path = require('path') | |
| module.exports = override( | |
| filterWarningsPlugin, | |
| fixBabelImports('antd', { | |
| libraryName: 'antd', | |
| libraryDirectory: 'es', | |
| style: true | |
| }), | |
| fixBabelImports('lodash', { | |
| libraryName: 'lodash', | |
| libraryDirectory: '', | |
| camel2DashComponentName: false | |
| }), | |
| fixBabelImports('ant-design-pro', { | |
| libraryName: 'ant-design-pro', | |
| libraryDirectory: 'lib', | |
| style: true, | |
| camel2DashComponentName: false | |
| }), | |
| addLessLoader({ | |
| javascriptEnabled: true, | |
| modifyVars: path.join(__dirname, './src/theme/vars.less'), | |
| }), | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment