svg.js 621 B

1234567891011121314151617181920212223242526
  1. // const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
  2. const { resolve, isProd } = require('../util');
  3. // const extractSVG = isProd;
  4. module.exports = () => config => {
  5. config.module = {
  6. ...config.module,
  7. };
  8. config.module.rules = [
  9. ...config.module.rules || [],
  10. {
  11. test: /\.svg$/,
  12. use: [{
  13. loader: 'svg-sprite-loader',
  14. options: {
  15. // extract: extractSVG,
  16. },
  17. }],
  18. include: [resolve('src/resources/svg')],
  19. },
  20. ];
  21. config.plugins = [
  22. ...config.plugins || [],
  23. // extractSVG && new SpriteLoaderPlugin(),
  24. ].filter(Boolean);
  25. };