webpack.dll.config.js 632 B

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