webpack.config.ts 692 B

12345678910111213141516171819202122232425262728293031
  1. /* eslint-disable import/no-extraneous-dependencies */
  2. import webpack from 'webpack';
  3. import path from 'path';
  4. import { CleanWebpackPlugin } from 'clean-webpack-plugin';
  5. const config: webpack.Configuration = {
  6. mode: 'development',
  7. entry: {
  8. injectCSP: './src/www/injectCSP.ts',
  9. injectCordovaScript: './src/www/injectCordovaScript.ts',
  10. },
  11. output: {
  12. filename: '[name].js',
  13. path: path.join(__dirname, 'scripts/www'),
  14. },
  15. devtool: 'eval-source-map',
  16. resolve: {
  17. extensions: ['.ts', '.js'],
  18. },
  19. module: {
  20. rules: [
  21. {
  22. test: /\.ts$/,
  23. use: 'ts-loader',
  24. },
  25. ],
  26. },
  27. plugins: [new CleanWebpackPlugin()],
  28. };
  29. export default config;