fix: only generate .sls directory when needed

This commit is contained in:
Pooya Parsa 2020-11-11 15:06:20 +01:00
parent 8414e64eeb
commit 696556aef8

View File

@ -26,7 +26,9 @@ export async function build (options: SLSOptions) {
await hooks.callHook('template:document', htmlTemplate)
await writeFile(htmlTemplate.dst, htmlTemplate.compiled)
if (options.targetDir.startsWith(options.slsDir)) {
emptyDir(options.slsDir)
}
options.rollupConfig = getRollupConfig(options)
await hooks.callHook('rollup:before', options)