webpack.config.js 673 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const path = require('path');
  2. const merge = require('deepmerge');
  3. const baseConfig = require('../base-webpack.config');
  4. const SpritePlugin = require('../../plugin');
  5. module.exports = merge(baseConfig, {
  6. context: __dirname,
  7. entry: './main',
  8. output: {
  9. path: path.resolve(__dirname, 'build'),
  10. publicPath: 'build/'
  11. },
  12. module: {
  13. rules: [
  14. {
  15. test: /\.svg$/,
  16. use: [
  17. {
  18. loader: 'svg-sprite-loader',
  19. options: {
  20. extract: true,
  21. publicPath: '/static/'
  22. }
  23. },
  24. 'svgo-loader'
  25. ]
  26. }
  27. ]
  28. },
  29. plugins: [
  30. new SpritePlugin()
  31. ]
  32. });