Skip to content

Instantly share code, notes, and snippets.

@nickmeldrum
Last active September 6, 2019 06:26
Show Gist options
  • Save nickmeldrum/3bc635a93d81caa87cb45f8846c1746e to your computer and use it in GitHub Desktop.
Save nickmeldrum/3bc635a93d81caa87cb45f8846c1746e to your computer and use it in GitHub Desktop.
aaa
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
function ZipPlugin() {}
ZipPlugin.prototype.apply = function applyZipPlugin(compiler) {
compiler.hooks.emit.tapAsync({ name: 'ZipPlugin' }, function tapAsync(compilation, callback) {
const { assets } = compilation;
if (compilation.compiler.isChild()) {
callback();
}
console.log(Object.keys(assets));
callback();
});
};
module.exports = ZipPlugin;
/* eslint-enable @typescript-eslint/no-empty-function */
/* eslint-enable @typescript-eslint/explicit-function-return-type */
const path = require('path'); // eslint-disable-line @typescript-eslint/no-var-requires
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); // eslint-disable-line @typescript-eslint/no-var-requires
const ZipPlugin = require('./ci_cd/zip.webpack.plugin.js'); // eslint-disable-line @typescript-eslint/no-var-requires
module.exports = {
mode: 'production',
devtool: 'inline-source-map',
entry: {
investorprofile: './src/lambdas/investor-profile/index.ts',
portfoliorecommendation: './src/lambdas/portfolio-recommendation/index.ts',
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name]',
},
resolve: {
extensions: ['.ts'],
plugins: [new TsconfigPathsPlugin()],
},
module: {
rules: [
{
test: /.ts$/,
use: [{ loader: 'ts-loader', options: { transpileOnly: true } }],
},
],
},
plugins: [new ZipPlugin()],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment