config-overrides.js 857 B

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