diff --git a/.eslintignore b/.eslintignore index 199ebb76f825..6273a95b152e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -21,3 +21,4 @@ packages/create-docusaurus/lib/* packages/create-docusaurus/templates/facebook website/_dogfooding/_swizzle_theme_tests +website/_dogfooding/_asset-tests/badSyntax.js diff --git a/.prettierignore b/.prettierignore index 60603eea3fed..fe032054f7ef 100644 --- a/.prettierignore +++ b/.prettierignore @@ -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 diff --git a/.stylelintignore b/.stylelintignore index 9b97556a56cd..b3ca39978d98 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -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 diff --git a/packages/docusaurus/src/webpack/plugins/StaticDirectoriesCopyPlugin.ts b/packages/docusaurus/src/webpack/plugins/StaticDirectoriesCopyPlugin.ts index 3e5ec8ddb78a..31f87c0ed3ea 100644 --- a/packages/docusaurus/src/webpack/plugins/StaticDirectoriesCopyPlugin.ts +++ b/packages/docusaurus/src/webpack/plugins/StaticDirectoriesCopyPlugin.ts @@ -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, + }, })), }); } diff --git a/website/_dogfooding/_asset-tests/badSyntax.css b/website/_dogfooding/_asset-tests/badSyntax.css new file mode 100644 index 000000000000..84dbcfead3cd --- /dev/null +++ b/website/_dogfooding/_asset-tests/badSyntax.css @@ -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 diff --git a/website/_dogfooding/_asset-tests/badSyntax.js b/website/_dogfooding/_asset-tests/badSyntax.js new file mode 100644 index 000000000000..35e697a040a8 --- /dev/null +++ b/website/_dogfooding/_asset-tests/badSyntax.js @@ -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 diff --git a/website/tsconfig.json b/website/tsconfig.json index ca5671a8a65c..caea2e3443e5 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -36,5 +36,5 @@ "skipLibCheck": false, "types": ["jest"] }, - "exclude": ["src/sw.js"] + "exclude": ["build", ".docusaurus", "src/sw.js", "_dogfooding/_asset-tests"] }