Skip to content

Commit

Permalink
Prepend main css file to the main bundle's css file
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman committed May 13, 2021
1 parent 7b72a3f commit 3a0c0fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log
yarn.lock
/test-app/package-lock.json
/test-app/.dojorc
.vscode/
9 changes: 8 additions & 1 deletion src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
staticOnly.push('build-elide');
entry = {
[bootstrapEntry]: removeEmpty([
existsSync(mainCssPath) ? mainCssPath : null,
'@dojo/framework/shim/Promise',
'@dojo/webpack-contrib/bootstrap-plugin/async'
])
Expand Down Expand Up @@ -500,6 +499,14 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
__MAIN_ENTRY: JSON.stringify(mainEntryPath),
__DOJO_SCOPE: `'${libraryName}'`
}),
!singleBundle &&
existsSync(mainCssPath) &&
new WrapperPlugin({
test: new RegExp(`${mainEntry}.*(\.css$)`),
header: () => {
return readFileSync(mainCssPath);
}
}),
!isExperimentalSpeed &&
new OptimizeCssAssetsPlugin({
cssProcessor: cssnano,
Expand Down

0 comments on commit 3a0c0fb

Please sign in to comment.