webpack.dll.conf.js 563 B

123456789101112131415161718192021222324
  1. const path = require("path"),
  2. fs = require('fs'),
  3. webpack = require("webpack");
  4. const vendors = ['react', 'echarts', 'react-dom', 'mobx', 'mobx-react', 'react-router', 'react-router-dom', 'moment', 'lodash', 'axios'];
  5. module.exports = {
  6. entry: {
  7. vendor: vendors
  8. },
  9. output: {
  10. path: path.join(__dirname, "../dist"),
  11. filename: "Dll.js",
  12. library: "[name]_[hash]"
  13. },
  14. plugins: [
  15. new webpack.DllPlugin({
  16. path: path.join(__dirname, "../dist", "manifest.json"),
  17. name: "[name]_[hash]",
  18. context: __dirname
  19. })
  20. ]
  21. };