config-overrides.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint-disable @typescript-eslint/no-var-requires */
  2. const path = require('path')
  3. const StylelintPlugin = require('stylelint-webpack-plugin')
  4. const CircularDependencyPlugin = require('circular-dependency-plugin')
  5. const { override, addBabelPlugin, addWebpackAlias, addWebpackModuleRule, addWebpackPlugin } = require('customize-cra')
  6. module.exports = {
  7. webpack: override(
  8. addBabelPlugin('@emotion/babel-plugin'),
  9. addWebpackPlugin(new StylelintPlugin({ files: './src/**/*.{tsx,ts}' })),
  10. addWebpackPlugin(
  11. new CircularDependencyPlugin({
  12. exclude: /a\.js|node_modules/,
  13. })
  14. ),
  15. addWebpackAlias({
  16. '@': path.resolve(__dirname, 'src/'),
  17. }),
  18. addWebpackModuleRule({
  19. test: /\.(graphql|gql)$/,
  20. exclude: /node_modules/,
  21. loader: 'graphql-tag/loader',
  22. }),
  23. addWebpackModuleRule({
  24. test: /\.mjs$/,
  25. include: /node_modules/,
  26. type: 'javascript/auto',
  27. })
  28. ),
  29. paths: (paths) => {
  30. paths.appBuild = path.resolve(__dirname, 'dist')
  31. return paths
  32. },
  33. }