您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

webpack.config.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const HtmlWebpackPlugin = require('html-webpack-plugin');
  4. module.exports = {
  5. entry: './src/index.js',
  6. output: {
  7. filename: 'main.js',
  8. path: path.resolve(__dirname, 'dist'),
  9. clean: true,
  10. },
  11. resolve: {
  12. alias: {
  13. 'client': path.join(__dirname, '../pkg/')
  14. },
  15. fallback: {
  16. "buffer": require.resolve("buffer")
  17. }
  18. },
  19. devServer: {
  20. static: {
  21. directory: path.join(__dirname, 'dist'),
  22. },
  23. compress: true,
  24. port: 9000,
  25. client: {
  26. logging: 'none',
  27. progress: true,
  28. overlay: {
  29. errors: true,
  30. warnings: false,
  31. }
  32. },
  33. },
  34. plugins: [
  35. new webpack.ProvidePlugin({
  36. Buffer: ['buffer', 'Buffer'],
  37. }),
  38. new HtmlWebpackPlugin({
  39. title: 'My App',
  40. template: 'assets/index.html'
  41. })
  42. ],
  43. experiments: {
  44. asyncWebAssembly: true
  45. }
  46. };