You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.js 1.1KB

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