Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): bundler should not minimize static assets #10658

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/facebook

website/_dogfooding/_swizzle_theme_tests
website/_dogfooding/_asset-tests/badSyntax.js
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ website/static/katex/katex.min.css

website/changelog
website/_dogfooding/_swizzle_theme_tests
website/_dogfooding/_asset-tests/badSyntax.js
website/_dogfooding/_asset-tests/badSyntax.css
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ packages/docusaurus-*/lib/*
packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/
website/static/katex/katex.min.css
website/_dogfooding/_asset-tests/badSyntax.css

jest/vendor
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export async function createStaticDirectoriesCopyPlugin({
from: dir,
to: outDir,
toType: 'dir',
info: {
// Prevents Webpack from minimizing static files (js/css)
// see https://github.com/facebook/docusaurus/pull/10658
// see https://github.com/webpack-contrib/copy-webpack-plugin#skip-running-javascript-files-through-a-minimizer
minimized: true,
},
})),
});
}
7 changes: 7 additions & 0 deletions website/_dogfooding/_asset-tests/badSyntax.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


See https://github.com/facebook/docusaurus/issues/10460

Using bad JS syntax on purpose, this file shouldn't be processed and cause build errors, it should just be copied over.

import export with }{>< default switch
8 changes: 8 additions & 0 deletions website/_dogfooding/_asset-tests/badSyntax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Using bad JS syntax on purpose, this file shouldn't be processed and cause build errors, it should just be copied over.

import export with }{>< default switch

See https://github.com/facebook/docusaurus/issues/10460

See https://github.com/facebook/docusaurus/pull/10658
2 changes: 1 addition & 1 deletion website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"skipLibCheck": false,
"types": ["jest"]
},
"exclude": ["src/sw.js"]
"exclude": ["build", ".docusaurus", "src/sw.js", "_dogfooding/_asset-tests"]
}