webpack.config.js 650 B

123456789101112131415161718192021222324252627282930313233
  1. const path = require('path');
  2. const merge = require('deepmerge');
  3. const baseConfig = require('../base-webpack.config');
  4. const SpritePlugin = require('../../plugin');
  5. const config = 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. loader: 'svg-sprite-loader',
  17. options: {
  18. extract: true,
  19. runtimeGenerator: require.resolve('./extracting-runtime-generator.js')
  20. }
  21. }
  22. ]
  23. },
  24. plugins: [
  25. new SpritePlugin()
  26. ]
  27. });
  28. module.exports = config;