From a9c15875df05b8b205698cd9f72f6e6979894976 Mon Sep 17 00:00:00 2001 From: Quentin Deroubaix <139884126+quentinderoubaix@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:26:13 +0200 Subject: [PATCH] fix: sass exports (#915) --- core-bootstrap/package.json | 12 ++++++------ core-bootstrap/vite.config.ts | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core-bootstrap/package.json b/core-bootstrap/package.json index ce4702c3f3..be7f82bac2 100644 --- a/core-bootstrap/package.json +++ b/core-bootstrap/package.json @@ -38,13 +38,13 @@ "require": "./dist/config.cjs", "default": "./dist/config.js" }, - "./scss/*.scss": { - "require": "./src/scss/*.scss", - "default": "./src/scss/*.scss" + "./scss/*": { + "require": "./src/scss/*", + "default": "./src/scss/*" }, - "./css/*.css": { - "require": "./dist/css/*.css", - "default": "./dist/css/*.css" + "./css/*": { + "require": "./dist/css/*", + "default": "./dist/css/*" } }, "scripts": { diff --git a/core-bootstrap/vite.config.ts b/core-bootstrap/vite.config.ts index e7a69f3149..6577974c1c 100644 --- a/core-bootstrap/vite.config.ts +++ b/core-bootstrap/vite.config.ts @@ -15,7 +15,9 @@ const externalDependencies = [...Object.keys(dependencies)]; export default defineConfig(async (): Promise => { const entry: Record = {}; - for (const [, exportInfo] of Object.entries(pkgExports).filter(([key]) => !key.endsWith('css'))) { + const styleRegex = /\/(scss|css)\//; + + for (const [, exportInfo] of Object.entries(pkgExports).filter(([key]) => !key.match(styleRegex))) { const pattern = exportInfo.default.replace(/^\.\/dist\//, './src/').replace(/\.js$/, '.{ts,tsx}'); const files = await glob(pattern, {cwd: __dirname}); for (const file of files) {