defaults.js 722 B

1234567891011121314151617181920212223242526272829303132333435
  1. const path = require('path');
  2. const os = require('os');
  3. function create() {
  4. return {
  5. mode: 'development',
  6. output: {
  7. filename: '[name].js',
  8. // eslint-disable-next-line prettier/prettier
  9. path: path.join(os.tmpdir(), '_karma_webpack_') + Math.floor(Math.random() * 1000000),
  10. },
  11. stats: {
  12. modules: false,
  13. colors: true,
  14. },
  15. watch: false,
  16. optimization: {
  17. runtimeChunk: 'single',
  18. splitChunks: {
  19. chunks: 'all',
  20. minSize: 0,
  21. cacheGroups: {
  22. commons: {
  23. name: 'commons',
  24. chunks: 'all',
  25. minChunks: 1,
  26. },
  27. },
  28. },
  29. },
  30. plugins: [],
  31. };
  32. }
  33. module.exports = { create };