From 4e6fa69396005bdafe9825684c336d9ae3e5a053 Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Tue, 10 Dec 2024 11:34:24 +0000 Subject: [PATCH] Preserve 'use-client' directives during rollup Fixes warnings thrown during rollup that 'use-client' directives from the 'mui' package were ignored by instead preserving them. --- package-lock.json | 16 +++++++++++++++- package.json | 1 + rollup.config.mjs | 4 +++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53d19bf..da7840e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "rollup-plugin-dts": "^6.1.1", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.2", + "rollup-preserve-directives": "^1.1.3", "typescript": "^5.6.3", "vite": "^5.4.10", "vite-plugin-eslint": "^1.8.1", @@ -12676,6 +12677,19 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, + "node_modules/rollup-preserve-directives": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/rollup-preserve-directives/-/rollup-preserve-directives-1.1.3.tgz", + "integrity": "sha512-oXqxd6ZzkoQej8Qt0k+S/yvO2+S4CEVEVv2g85oL15o0cjAKTKEuo2MzyA8FcsBBXbtytBzBMFAbhvQg4YyPUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.5" + }, + "peerDependencies": { + "rollup": "^2.0.0 || ^3.0.0 || ^4.0.0" + } + }, "node_modules/rrweb-cssom": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", @@ -14800,4 +14814,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index c302699..615cbf7 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "rollup-plugin-dts": "^6.1.1", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.2", + "rollup-preserve-directives": "^1.1.3", "typescript": "^5.6.3", "vite": "^5.4.10", "vite-plugin-eslint": "^1.8.1", diff --git a/rollup.config.mjs b/rollup.config.mjs index 21993c7..8376d7c 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -5,6 +5,7 @@ import dts from "rollup-plugin-dts"; import postcss from "rollup-plugin-postcss"; import peerDepsExternal from "rollup-plugin-peer-deps-external"; +import preserveDirectives from 'rollup-preserve-directives' const config = [ { @@ -29,7 +30,8 @@ const config = [ tsconfig: "./tsconfig.json", compilerOptions: { outDir: "dist" } }), - postcss() + postcss(), + preserveDirectives() ] }, {