webpack.config.js 695 B

12345678910111213141516171819202122232425262728293031323334
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. module.exports = {
  4. mode: "development",
  5. entry: {
  6. main : "./target/main.js",
  7. workers : "./target/workers.js"
  8. },
  9. output: {
  10. path: path.resolve(__dirname, 'static/js'),
  11. filename: '[name]-bundle.js',
  12. clean: false,
  13. chunkLoading: false,
  14. },
  15. module: {
  16. rules: [
  17. {
  18. // docs: https://webpack.js.org/configuration/module/#resolvefullyspecified
  19. test: /\.m?js/,
  20. resolve: {
  21. fullySpecified: false,
  22. }
  23. }
  24. ]
  25. },
  26. plugins: [
  27. // fix "process is not defined" error:
  28. new webpack.ProvidePlugin({
  29. process: 'process/browser',
  30. }),
  31. ],
  32. };