Skip to content

Commit fee2980

Browse files
committed
Prepend main css file to the main bundle's css file
(cherry picked from commit 3a0c0fb)
1 parent 7b72a3f commit fee2980

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ npm-debug.log
66
yarn.lock
77
/test-app/package-lock.json
88
/test-app/.dojorc
9+
.vscode/

src/base.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
245245
staticOnly.push('build-elide');
246246
entry = {
247247
[bootstrapEntry]: removeEmpty([
248-
existsSync(mainCssPath) ? mainCssPath : null,
249248
'@dojo/framework/shim/Promise',
250249
'@dojo/webpack-contrib/bootstrap-plugin/async'
251250
])
@@ -500,6 +499,14 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
500499
__MAIN_ENTRY: JSON.stringify(mainEntryPath),
501500
__DOJO_SCOPE: `'${libraryName}'`
502501
}),
502+
!singleBundle &&
503+
existsSync(mainCssPath) &&
504+
new WrapperPlugin({
505+
test: new RegExp(`${mainEntry}.*(\.css$)`),
506+
header: () => {
507+
return readFileSync(mainCssPath);
508+
}
509+
}),
503510
!isExperimentalSpeed &&
504511
new OptimizeCssAssetsPlugin({
505512
cssProcessor: cssnano,

0 commit comments

Comments
 (0)