File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -35,4 +35,10 @@ build-and-upload: build
3535
3636build-and-publish : build
3737 make publish-assets
38- .PHONY : build-and-publish
38+ .PHONY : build-and-publish
39+
40+ local-server :
41+ yarn build
42+ node ./scripts/build-shells.js
43+ npx serve
44+ .PHONY : local-server
Original file line number Diff line number Diff line change @@ -22,13 +22,14 @@ files.forEach(file => {
2222 const libraryName = last ( libraryPath . split ( '/' ) ) . replace ( '.js' , '' ) ;
2323 const vendorPath = last ( vendor [ 0 ] . split ( 'build' ) ) ;
2424
25- const dynamic = `
26- window['${ libraryName } Deps'] = ["${ vendorPath } "]
25+ // We need this to remain a single line in order to not break source maps,
26+ // as well as put the bracket at the very end, this is so we don't change the line numbers
27+ // for the dynamic file
2728
28- window[' ${ libraryName } Loader'] = function() {
29- return ${ fs . readFileSync ( file ) . toString ( ) }
30- }
31- ` . trim ( ) ;
29+ // prettier-ignore
30+ const dynamic = `
31+ window[' ${ libraryName } Deps'] = [" ${ vendorPath } "];window[' ${ libraryName } Loader'] = function() { return ${ fs . readFileSync ( file ) . toString ( ) }
32+ }; `. trim ( ) ;
3233
3334 const filename = file . replace ( / \. j s $ / , '.dynamic.js' ) ;
3435 fs . writeFileSync ( filename + '.gz' , zlib . gzipSync ( dynamic ) ) ;
You can’t perform that action at this time.
0 commit comments