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

webpack.js 917B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const BomPlugin = require('webpack-utf8-bom');
  4. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
  5. module.exports = {
  6. mode: 'production',
  7. target: "web",
  8. entry: path.resolve(__dirname, 'src', 'main.ts'),
  9. output: {
  10. path: path.resolve(__dirname, 'lib', 'browser'),
  11. filename: "rjsvm.browser.js",
  12. libraryTarget: 'window'
  13. },
  14. resolve: {
  15. extensions: [".ts", ".tsx", ".js"],
  16. fallback: {
  17. buffer: require.resolve('buffer/'),
  18. }
  19. },
  20. module: {
  21. rules: [
  22. { test: /\.ts?$/, loader: "ts-loader" }
  23. ]
  24. },
  25. optimization: {
  26. minimize: true,
  27. },
  28. plugins: [
  29. new NodePolyfillPlugin(),
  30. new webpack.ProvidePlugin({
  31. Buffer: ['buffer', 'Buffer'],
  32. }),
  33. new webpack.ProvidePlugin({
  34. process: 'process/browser.js',
  35. }),
  36. new BomPlugin(true)
  37. ],
  38. externals: {
  39. }
  40. }