Skip to content

Instantly share code, notes, and snippets.

@annacoding2020
Created May 4, 2020 20:52
Show Gist options
  • Select an option

  • Save annacoding2020/5e82bbc1150cfaa9dd0d239a1d5464c7 to your computer and use it in GitHub Desktop.

Select an option

Save annacoding2020/5e82bbc1150cfaa9dd0d239a1d5464c7 to your computer and use it in GitHub Desktop.
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