Skip to content

Commit a49da14

Browse files
authored
Bundle ShikiJS for Webpack 4 (#5349)
* Bundle ShikiJS for Webpack 4 * Add entry * Use named exports
1 parent b245b63 commit a49da14

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
102102
- Fixes [#5319](https://github.com/microsoft/BotFramework-WebChat/issues/5319). Some Markdown text are not rendered after HTML tags, in PR [#5320](https://github.com/microsoft/BotFramework-WebChat/pull/5320), by [@compulim](https://github.com/compulim)
103103
- Fixes [#5323](https://github.com/microsoft/BotFramework-WebChat/issues/5323). Removed unused CSS class from carousel component, eliminating unintended styling, in PR [#5325](https://github.com/microsoft/BotFramework-WebChat/pull/5325), by [@OEvgeny](https://github.com/OEvgeny)
104104
- Resolved CSS class name conflicts between component and fluent packages to prevent styling issues, in PR [#5326](https://github.com/microsoft/BotFramework-WebChat/pull/5326), in PR [#5327](https://github.com/microsoft/BotFramework-WebChat/pull/5327), by [@OEvgeny](https://github.com/OEvgeny)
105+
- Fixed [#5350](https://github.com/microsoft/BotFramework-WebChat/issues/pull/5350). Bundled `shiki` in component package, in PR [#5349](https://github.com/microsoft/BotFramework-WebChat/pull5349), by [@compulim](https://github.com/compulim)
105106

106107
# Removed
107108

packages/component/tsup.config.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ import { decoratorStyleContent as decoratorStyleContentPlaceholder } from './src
66

77
const config: typeof baseConfig = {
88
...baseConfig,
9-
loader: {
10-
...baseConfig.loader,
11-
'.css': 'local-css'
9+
entry: {
10+
'botframework-webchat-component': './src/index.ts',
11+
'botframework-webchat-component.internal': './src/internal.ts',
12+
'botframework-webchat-component.decorator': './src/decorator/index.ts'
1213
},
1314
esbuildPlugins: [
1415
injectCSSPlugin({ stylesPlaceholder: componentStyleContentPlaceholder }),
1516
injectCSSPlugin({ stylesPlaceholder: decoratorStyleContentPlaceholder })
1617
],
17-
entry: {
18-
'botframework-webchat-component': './src/index.ts',
19-
'botframework-webchat-component.internal': './src/internal.ts',
20-
'botframework-webchat-component.decorator': './src/decorator/index.ts'
21-
}
18+
loader: {
19+
...baseConfig.loader,
20+
'.css': 'local-css'
21+
},
22+
noExternal: [
23+
// Belows are the dependency chain related to "regex" where it is named export-only and does not work on Webpack 4/PPUX (CJS cannot import named export).
24+
// Webpack 4: "Can't import the named export 'rewrite' from non EcmaScript module (only default export is available)"
25+
'shiki', // shiki -> @shikijs/core -> @shikijs/engine-javascript -> regex
26+
]
2227
};
2328

2429
export default defineConfig([

0 commit comments

Comments
 (0)