webpack.config.js 609 B

12345678910111213141516171819202122232425262728293031323334
  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: { extract: true }
  20. },
  21. 'svgo-loader'
  22. ]
  23. }
  24. ]
  25. },
  26. plugins: [
  27. new SpritePlugin()
  28. ]
  29. });