Няма описание

config-overrides.js 903B

12345678910111213141516171819202122232425262728293031323334353637
  1. const fs = require('fs');
  2. const path = require('path');
  3. const rootPath = fs.realpathSync(process.cwd());
  4. const srcPath = path.resolve(rootPath, )
  5. module.exports = function override(config, env) {
  6. console.log('config: ', config);
  7. console.log('env: ', env);
  8. config.resolve.extensions = ['.js', '.jsx', '.ts', '.tsx', '.less', '.json'];
  9. config.resolve.alias = {
  10. '@': srcPath,
  11. '@components': `${srcPath}srcPath/components`,
  12. };
  13. config.module.rules.push({
  14. test: /\.less$/,
  15. use: [
  16. 'style-loader',
  17. {
  18. loader: 'css-loader',// translates CSS into CommonJS
  19. options: {
  20. modules: {
  21. localIdentName: '[name]__[local]___[hash:base64:5]',
  22. },
  23. }
  24. },
  25. 'postcss-loader',
  26. {
  27. loader: 'less-loader',
  28. options: {
  29. javascriptEnabled: true,
  30. },
  31. }],
  32. exclude: /node_modules|antd\.less/,
  33. });
  34. return config;
  35. }