webpack.config.js 676 B

12345678910111213141516171819202122232425262728293031
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  4. module.exports = {
  5. entry: './src/LSPlugin.user.ts',
  6. module: {
  7. rules: [
  8. {
  9. test: /\.tsx?$/,
  10. use: 'ts-loader',
  11. exclude: /node_modules/,
  12. },
  13. ],
  14. },
  15. resolve: {
  16. extensions: ['.tsx', '.ts', '.js'],
  17. },
  18. plugins: [
  19. new webpack.ProvidePlugin({
  20. process: 'process/browser',
  21. }),
  22. // new BundleAnalyzerPlugin()
  23. ],
  24. output: {
  25. library: 'LSPluginEntry',
  26. libraryTarget: 'umd',
  27. filename: 'lsplugin.user.js',
  28. path: path.resolve(__dirname, 'dist')
  29. },
  30. }