From 3c962013b5325932887c990cd55f47ca60b502e9 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Wed, 20 Oct 2021 13:43:21 +0330 Subject: [PATCH] fix(nitro): bundle json files (#1245) --- packages/nitro/src/rollup/plugins/externals.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nitro/src/rollup/plugins/externals.ts b/packages/nitro/src/rollup/plugins/externals.ts index 85e1de65e4..627ce7ae13 100644 --- a/packages/nitro/src/rollup/plugins/externals.ts +++ b/packages/nitro/src/rollup/plugins/externals.ts @@ -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 } }