fix(nitro): bundle json files (#1245)

This commit is contained in:
Ahad Birang 2021-10-20 13:43:21 +03:30 committed by GitHub
parent d166b78e06
commit 3c962013b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,8 @@ export function externals (opts: NodeExternalsOptions): Plugin {
if (_id.startsWith('.') || opts.inline.find(i => _id.startsWith(i) || id.startsWith(i))) {
return null
}
// Bundle ts and wasm (currently - see https://github.com/nuxt/framework/discussions/692)
if (_id.endsWith('.ts') || _id.endsWith('.wasm')) {
// Bundle typescript, json and wasm (see https://github.com/nuxt/framework/discussions/692)
if (/\.(ts|wasm|json)$/.test(_id)) {
return null
}
}