From f9ae953acf72a35047c6193be20f74f138578927 Mon Sep 17 00:00:00 2001 From: DuCanhGH <75556609+DuCanhGH@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:00:43 +0700 Subject: [PATCH] fix(core): fixed rollup/plugin-terser causing build to fail --- packages/next-pwa/rollup.config.js | 4 ++++ packages/next-pwa/tsconfig.json | 2 +- packages/tsconfig/package.json | 5 +++++ packages/tsconfig/{base.json => src/base/tsconfig.json} | 1 - 4 files changed, 10 insertions(+), 2 deletions(-) rename packages/tsconfig/{base.json => src/base/tsconfig.json} (91%) diff --git a/packages/next-pwa/rollup.config.js b/packages/next-pwa/rollup.config.js index fcd23e83..fc2e0271 100644 --- a/packages/next-pwa/rollup.config.js +++ b/packages/next-pwa/rollup.config.js @@ -2,6 +2,10 @@ import terser from "@rollup/plugin-terser"; import typescript from "@rollup/plugin-typescript"; import { defineConfig } from "rollup"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +global.__filename = __filename; const commonConfig = defineConfig({ watch: { diff --git a/packages/next-pwa/tsconfig.json b/packages/next-pwa/tsconfig.json index a1d7a2da..ede72987 100644 --- a/packages/next-pwa/tsconfig.json +++ b/packages/next-pwa/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "tsconfig/base.json", + "extends": "tsconfig/base", "include": ["globals.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules", "dist"] } diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index 6efb83e1..ea72e282 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -5,5 +5,10 @@ "license": "MIT", "publishConfig": { "access": "public" + }, + "typesVersions": { + "*": { + "*": ["src/*/tsconfig.json"] + } } } diff --git a/packages/tsconfig/base.json b/packages/tsconfig/src/base/tsconfig.json similarity index 91% rename from packages/tsconfig/base.json rename to packages/tsconfig/src/base/tsconfig.json index e102706c..1eca4269 100644 --- a/packages/tsconfig/base.json +++ b/packages/tsconfig/src/base/tsconfig.json @@ -1,5 +1,4 @@ { - "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ESNext", "module": "ESNext",