Skip to content

Commit 79f7dc5

Browse files
fix(components-react): add file extension to relative export paths (#6082)
1 parent a205b95 commit 79f7dc5

File tree

5 files changed

+135
-23
lines changed

5 files changed

+135
-23
lines changed

.changeset/brown-peaches-like.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@swisspost/design-system-components-react': patch
3+
---
4+
5+
Added file extensions in relative import/export statements to make them browser conform.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './stencil-generated/server/components';
1+
export * from './stencil-generated/server/components.js';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './stencil-generated/components';
1+
export * from './stencil-generated/components.js';

packages/components/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"start": "pnpm prebuild:script && stencil build --dev --watch --docs --docs-readme",
6161
"prebuild": "pnpm clean && pnpm prebuild:script",
6262
"build": "stencil build --docs-readme",
63-
"postbuild": "pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
63+
"postbuild": "pnpm fix:export:components-react & pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
6464
"clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated ../components-react/**/stencil-generated/ ../components-angular/projects/components/src/lib/stencil-generated/",
6565
"unit": "stencil test --spec",
6666
"unit:watch": "stencil test --spec --watchAll --silent",
@@ -72,6 +72,7 @@
7272
"lint:fix": "eslint --fix",
7373
"generate": "stencil generate",
7474
"prebuild:script": "node --loader ts-node/esm prebuild.ts",
75+
"fix:export:components-react": "replace './components.server' './components.server.js' ../components-react/src/stencil-generated/server/components.ts",
7576
"copy:styles:components-react": "copyfiles -f www/build/post-components.css ../components-react/src/stencil-generated/",
7677
"copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/projects/components/src/lib/stencil-generated/"
7778
},
@@ -108,6 +109,7 @@
108109
"eslint-plugin-react": "7.37.5",
109110
"globals": "16.0.0",
110111
"mock-fs": "5.5.0",
112+
"replace": "1.2.2",
111113
"rimraf": "6.0.1",
112114
"rollup-plugin-postcss": "4.0.2",
113115
"sass": "1.89.2",

0 commit comments

Comments
 (0)