Generate metafile
This commit is contained in:
parent
42bc17b891
commit
e286008e08
|
@ -31,6 +31,7 @@ function runBuild(entry, outfile) {
|
||||||
loader: {
|
loader: {
|
||||||
".svelte": "copy",
|
".svelte": "copy",
|
||||||
},
|
},
|
||||||
|
metafile: true,
|
||||||
packages: "external",
|
packages: "external",
|
||||||
external: [
|
external: [
|
||||||
"deasync",
|
"deasync",
|
||||||
|
@ -51,7 +52,7 @@ function runBuild(entry, outfile) {
|
||||||
...sharedConfig,
|
...sharedConfig,
|
||||||
platform: "node",
|
platform: "node",
|
||||||
outfile,
|
outfile,
|
||||||
}).then(() => {
|
}).then(result => {
|
||||||
glob(`${process.cwd()}/src/**/*.hbs`, {}, (err, files) => {
|
glob(`${process.cwd()}/src/**/*.hbs`, {}, (err, files) => {
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
fs.copyFileSync(file, `${process.cwd()}/dist/${path.basename(file)}`)
|
fs.copyFileSync(file, `${process.cwd()}/dist/${path.basename(file)}`)
|
||||||
|
@ -62,6 +63,11 @@ function runBuild(entry, outfile) {
|
||||||
`Build successfully in ${(Date.now() - start) / 1000} seconds`
|
`Build successfully in ${(Date.now() - start) / 1000} seconds`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
`dist/${path.basename(outfile)}.meta.json`,
|
||||||
|
JSON.stringify(result.metafile)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue