File tree Expand file tree Collapse file tree 6 files changed +117
-98
lines changed Expand file tree Collapse file tree 6 files changed +117
-98
lines changed Original file line number Diff line number Diff line change 13
13
"@reach/router" : " ^1.2.1" ,
14
14
"common-tags" : " ^1.8.0" ,
15
15
"express" : " ^4.16.2" ,
16
+ "normalize.css" : " ^8.0.1" ,
16
17
"razzle" : " ^3.0.0-alpha.0" ,
17
18
"react" : " ^16.0.0" ,
18
19
"react-dom" : " ^16.0.0"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const LoadableBabelPlugin = require('@loadable/babel-plugin')
4
4
const babelPresetRazzle = require ( 'razzle/babel' )
5
5
6
6
module . exports = {
7
- modify : ( config , { target } ) => {
7
+ modify : ( config , { dev , target } ) => {
8
8
const appConfig = Object . assign ( { } , config )
9
9
10
10
if ( target === 'web' ) {
@@ -17,6 +17,18 @@ module.exports = {
17
17
writeToDisk : { filename } ,
18
18
} ) ,
19
19
]
20
+
21
+ appConfig . output . filename = dev
22
+ ? 'static/js/[name].js'
23
+ : 'static/js/[name].[chunkhash:8].js'
24
+
25
+ appConfig . optimization = Object . assign ( { } , appConfig . optimization , {
26
+ runtimeChunk : true ,
27
+ splitChunks : {
28
+ chunks : 'all' ,
29
+ name : dev ,
30
+ } ,
31
+ } )
20
32
}
21
33
22
34
return appConfig
Original file line number Diff line number Diff line change
1
+ import 'normalize.css'
1
2
import React from 'react'
2
3
import { hydrate } from 'react-dom'
3
4
import { loadableReady } from '@loadable/component'
Original file line number Diff line number Diff line change @@ -5944,6 +5944,11 @@ normalize-url@^3.0.0:
5944
5944
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
5945
5945
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==
5946
5946
5947
+ normalize.css@^8.0.1 :
5948
+ version "8.0.1"
5949
+ resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3"
5950
+ integrity sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==
5951
+
5947
5952
npm-bundled@^1.0.1 :
5948
5953
version "1.0.5"
5949
5954
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979"
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ class ChunkExtractor {
293
293
// Main assets
294
294
295
295
getMainAssets ( scriptType ) {
296
- const chunks = [ ...this . chunks , ...this . entrypoints ]
296
+ const chunks = [ ...this . entrypoints , ...this . chunks ]
297
297
const assets = this . getChunkAssets ( chunks )
298
298
if ( scriptType ) {
299
299
return assets . filter ( asset => asset . scriptType === scriptType )
@@ -359,7 +359,7 @@ class ChunkExtractor {
359
359
360
360
getPreAssets ( ) {
361
361
const mainAssets = this . getMainAssets ( )
362
- const chunks = [ ...this . chunks , ...this . entrypoints ]
362
+ const chunks = [ ...this . entrypoints , ...this . chunks ]
363
363
const preloadAssets = this . getChunkChildAssets ( chunks , 'preload' )
364
364
const prefetchAssets = this . getChunkChildAssets ( chunks , 'prefetch' )
365
365
return [ ...mainAssets , ...preloadAssets , ...prefetchAssets ]
You can’t perform that action at this time.
0 commit comments