mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-27 15:07:53 +02:00
feat(v2): separate runtimechunk (#1355)
* feat(v2): separate runtimechunk * nits
This commit is contained in:
parent
415d2b33d1
commit
f95ac033fd
2 changed files with 5 additions and 2 deletions
|
@ -86,8 +86,6 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
||||||
plugins: [
|
plugins: [
|
||||||
// Generates an `index.html` file with the <script> injected.
|
// Generates an `index.html` file with the <script> injected.
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: false,
|
|
||||||
hash: true,
|
|
||||||
template: path.resolve(
|
template: path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../client/templates/index.html.template.ejs',
|
'../client/templates/index.html.template.ejs',
|
||||||
|
|
|
@ -20,6 +20,11 @@ module.exports = function createClientConfig(props) {
|
||||||
entry: {
|
entry: {
|
||||||
main: path.resolve(__dirname, '../client/clientEntry.js'),
|
main: path.resolve(__dirname, '../client/clientEntry.js'),
|
||||||
},
|
},
|
||||||
|
optimization: {
|
||||||
|
// Keep the runtime chunk separated to enable long term caching
|
||||||
|
// https://twitter.com/wSokra/status/969679223278505985
|
||||||
|
runtimeChunk: true,
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// Generate manifests file
|
// Generate manifests file
|
||||||
new ReactLoadableSSRAddon({
|
new ReactLoadableSSRAddon({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue