webpack.config.js 613 B

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