webpack.browser.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. alias: {
  22. assert: 'assert'
  23. },
  24. extensions: ['.ts', '.js']
  25. },
  26. plugins: [
  27. new webpack.BannerPlugin(
  28. {
  29. banner: WebpackUtils.getBannerText(WebpackUtils.getLicenseText()),
  30. raw: true,
  31. entryOnly: false
  32. }
  33. ),
  34. new webpack.EnvironmentPlugin({
  35. VERSION: packageJson.version
  36. })
  37. ],
  38. output: {
  39. libraryTarget: 'umd',
  40. library: 'JavaScriptObfuscator',
  41. filename: 'index.browser.js'
  42. },
  43. performance: {
  44. hints: false
  45. },
  46. stats: {
  47. excludeModules: true,
  48. warnings: false
  49. }
  50. };