Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compiler.hooks.afterEmit.tap("SamPlugin", (compilation: any) => {
if (this.samConfigs && this.launchConfig) {
for (const samConfig of this.samConfigs) {
fs.writeFileSync(`${samConfig.buildRoot}/template.yaml`, yamlDump(samConfig.samConfig));
}
if (this.options.vscodeDebug) {
if (!fs.existsSync(".vscode")) {
fs.mkdirSync(".vscode");
}
fs.writeFileSync(".vscode/launch.json", JSON.stringify(this.launchConfig));
}
} else {
console.log("It looks like SamPlugin.entry() was not called");
}
});
}