webpack.browser.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. const webpack = require('webpack');
  3. const packageJson = require('pjson');
  4. const WebpackUtils = require('./utils/WebpackUtils').WebpackUtils;
  5. module.exports = {
  6. devtool: 'source-map',
  7. entry: {
  8. 'index': './index.ts'
  9. },
  10. target: 'web',
  11. module: {
  12. exprContextCritical: false,
  13. rules: [
  14. {
  15. test: /\.ts$/,
  16. loader: 'ts-loader'
  17. }
  18. ]
  19. },
  20. resolve: {
  21. extensions: ['.ts', '.js']
  22. },
  23. plugins: [
  24. new webpack.BannerPlugin(
  25. {
  26. banner: WebpackUtils.getBannerText(WebpackUtils.getLicenseText()),
  27. raw: true,
  28. entryOnly: false
  29. }
  30. ),
  31. new webpack.EnvironmentPlugin({
  32. VERSION: packageJson.version
  33. })
  34. ],
  35. output: {
  36. libraryTarget: 'umd',
  37. library: 'JavaScriptObfuscator',
  38. filename: 'index.browser.js'
  39. },
  40. performance: {
  41. hints: false
  42. },
  43. stats: {
  44. excludeModules: true,
  45. warnings: false
  46. }
  47. };