craco.config.js 1.2 KB

123456789101112131415161718192021222324252627282930
  1. const path = require('path');
  2. module.exports = {
  3. webpack: {
  4. configure: (webpackConfig) => {
  5. // 设置 publicPath
  6. // webpackConfig.output.publicPath = 'http://192.168.1.4:8081/';
  7. // 返回修改后的配置
  8. return webpackConfig;
  9. },
  10. alias: {
  11. '@components': path.resolve(__dirname, 'src/components'),
  12. '@ui': path.resolve(__dirname, 'src/ui'),
  13. '@pages': path.resolve(__dirname, 'src/pages'),
  14. '@assets': path.resolve(__dirname, 'src/assets'),
  15. '@styles': path.resolve(__dirname, 'src/styles'),
  16. '@db': path.resolve(__dirname, 'src/db'),
  17. '@hooks': path.resolve(__dirname, 'src/hooks'),
  18. '@layout': path.resolve(__dirname, 'src/layout'),
  19. '@fonts': path.resolve(__dirname, 'src/fonts'),
  20. '@utils': path.resolve(__dirname, 'src/utils'),
  21. '@widgets': path.resolve(__dirname, 'src/widgets'),
  22. '@contexts': path.resolve(__dirname, 'src/contexts'),
  23. '@constants': path.resolve(__dirname, 'src/constants'),
  24. '@features': path.resolve(__dirname, 'src/features'),
  25. '@api':path.resolve(__dirname,'src/api'),
  26. },
  27. }
  28. };