Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. /* eslint-disable @typescript-eslint/no-empty-function */
  2. /* eslint-disable @typescript-eslint/explicit-function-return-type */
  3. function ZipPlugin() {}
  4.  
  5. ZipPlugin.prototype.apply = function applyZipPlugin(compiler) {
  6. compiler.hooks.emit.tapAsync({ name: 'ZipPlugin' }, function tapAsync(compilation, callback) {
  7. const { assets } = compilation;
  8.  
  9. if (compilation.compiler.isChild()) {
  10. callback();
  11. }
  12.  
  13. console.log(Object.keys(assets));
  14.  
  15. callback();
  16. });
  17. };
  18.  
  19. module.exports = ZipPlugin;
  20. /* eslint-enable @typescript-eslint/no-empty-function */
  21. /* eslint-enable @typescript-eslint/explicit-function-return-type */
  22.  
  23.  
  24.  
  25.  
  26.  
  27. const path = require('path'); // eslint-disable-line @typescript-eslint/no-var-requires
  28. const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); // eslint-disable-line @typescript-eslint/no-var-requires
  29. const ZipPlugin = require('./ci_cd/zip.webpack.plugin.js'); // eslint-disable-line @typescript-eslint/no-var-requires
  30.  
  31. module.exports = {
  32. mode: 'production',
  33. devtool: 'inline-source-map',
  34. entry: {
  35. investorprofile: './src/lambdas/investor-profile/index.ts',
  36. portfoliorecommendation: './src/lambdas/portfolio-recommendation/index.ts',
  37. },
  38. output: {
  39. path: path.join(__dirname, 'dist'),
  40. filename: '[name]',
  41. },
  42. resolve: {
  43. extensions: ['.ts'],
  44. plugins: [new TsconfigPathsPlugin()],
  45. },
  46. module: {
  47. rules: [
  48. {
  49. test: /.ts$/,
  50. use: [{ loader: 'ts-loader', options: { transpileOnly: true } }],
  51. },
  52. ],
  53. },
  54. plugins: [new ZipPlugin()],
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement