webpack.config.js 763 B

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