File tree 1 file changed +9
-2
lines changed
packages/gatsby-plugin-offline/src
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,19 @@ const _ = require(`lodash`)
8
8
9
9
let getResourcesFromHTML = require ( `./get-resources-from-html` )
10
10
11
- exports . createPages = ( { actions } ) => {
11
+ exports . onPreBootstrap = ( { cache } ) => {
12
+ const appShellSourcePath = path . join ( __dirname , `app-shell.js` )
13
+ const appShellTargetPath = path . join ( cache . directory , `app-shell.js` )
14
+ fs . copyFileSync ( appShellSourcePath , appShellTargetPath )
15
+ }
16
+
17
+ exports . createPages = ( { actions, cache } ) => {
18
+ const appShellPath = path . join ( cache . directory , `app-shell.js` )
12
19
if ( process . env . NODE_ENV === `production` ) {
13
20
const { createPage } = actions
14
21
createPage ( {
15
22
path : `/offline-plugin-app-shell-fallback/` ,
16
- component : slash ( path . resolve ( ` ${ __dirname } /app-shell.js` ) ) ,
23
+ component : slash ( appShellPath ) ,
17
24
} )
18
25
}
19
26
}
You can’t perform that action at this time.
0 commit comments