Skip to content

Commit

Permalink
fix: sass exports (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinderoubaix authored Sep 10, 2024
1 parent 303e617 commit a9c1587
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions core-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion core-bootstrap/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const externalDependencies = [...Object.keys(dependencies)];
export default defineConfig(async (): Promise<UserConfig> => {
const entry: Record<string, string> = {};

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) {
Expand Down

0 comments on commit a9c1587

Please sign in to comment.