mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
fix(core): bundler should not minimize static assets (#10658)
This commit is contained in:
parent
0c791fb4e9
commit
d268a20a6f
7 changed files with 26 additions and 1 deletions
|
@ -21,3 +21,4 @@ packages/create-docusaurus/lib/*
|
||||||
packages/create-docusaurus/templates/facebook
|
packages/create-docusaurus/templates/facebook
|
||||||
|
|
||||||
website/_dogfooding/_swizzle_theme_tests
|
website/_dogfooding/_swizzle_theme_tests
|
||||||
|
website/_dogfooding/_asset-tests/badSyntax.js
|
||||||
|
|
|
@ -29,3 +29,5 @@ website/static/katex/katex.min.css
|
||||||
|
|
||||||
website/changelog
|
website/changelog
|
||||||
website/_dogfooding/_swizzle_theme_tests
|
website/_dogfooding/_swizzle_theme_tests
|
||||||
|
website/_dogfooding/_asset-tests/badSyntax.js
|
||||||
|
website/_dogfooding/_asset-tests/badSyntax.css
|
||||||
|
|
|
@ -13,5 +13,6 @@ packages/docusaurus-*/lib/*
|
||||||
packages/create-docusaurus/lib/*
|
packages/create-docusaurus/lib/*
|
||||||
packages/create-docusaurus/templates/
|
packages/create-docusaurus/templates/
|
||||||
website/static/katex/katex.min.css
|
website/static/katex/katex.min.css
|
||||||
|
website/_dogfooding/_asset-tests/badSyntax.css
|
||||||
|
|
||||||
jest/vendor
|
jest/vendor
|
||||||
|
|
|
@ -54,6 +54,12 @@ export async function createStaticDirectoriesCopyPlugin({
|
||||||
from: dir,
|
from: dir,
|
||||||
to: outDir,
|
to: outDir,
|
||||||
toType: 'dir',
|
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
website/_dogfooding/_asset-tests/badSyntax.css
Normal file
7
website/_dogfooding/_asset-tests/badSyntax.css
Normal file
|
@ -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
website/_dogfooding/_asset-tests/badSyntax.js
Normal file
8
website/_dogfooding/_asset-tests/badSyntax.js
Normal file
|
@ -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
|
|
@ -36,5 +36,5 @@
|
||||||
"skipLibCheck": false,
|
"skipLibCheck": false,
|
||||||
"types": ["jest"]
|
"types": ["jest"]
|
||||||
},
|
},
|
||||||
"exclude": ["src/sw.js"]
|
"exclude": ["build", ".docusaurus", "src/sw.js", "_dogfooding/_asset-tests"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue