Issue by activescott
Sunday Mar 18, 2018 at 10:58 GMT
Originally opened as https://github.com/forkdelta/forkdelta.github.io/pull/131
NOTE: I suggest we ignore the content below here and use the PR for the latest information at #35
This definitely needs a lot of testing but appears to be working.
To test just checkout the branch and run as usual.
To re-build js/main-bundle.js from the modules run npm run build from the root directory.
To unpack the modules from the old minified code again
- Extract the huge array of modules embedded inside of
js/main-unminified.js and put it in scripts/_old_main_packed_modules.js note: If you look carefully this whole ~150K line array is an argument to a function, so I can't think of a clean way to grab it from the script without more sophisticated (and error pone) parsing. Alternatively, if this branch is going to live for more than a week or so we could just adjust js/main-unminified.js to pop that array out into a field in the file and then I could safely get at it from the script. Since this is a one-time thing though I think it is just as easy to just manually extract it.
- From
scripts, run node unpack_modules.js (it unpacks from scripts/_old_main_packed_modules.js)
- In the generated
scripts/unpacked_modules/main.js there is one require('../server/utility.js') that needs converted to require('./server/utility.js')
cp -r scripts/unpacked_modules/* js/
- Then re-build
js/main-bundle.js by running npm run build from the root directory
This is a one-time thing so we shouldn't need the script or to re-run this unless we need it for some merges before this gets merged.
activescott included the following code: https://github.com/forkdelta/forkdelta.github.io/pull/131/commits
Sunday Mar 18, 2018 at 10:58 GMT
Originally opened as https://github.com/forkdelta/forkdelta.github.io/pull/131
NOTE: I suggest we ignore the content below here and use the PR for the latest information at #35
This definitely needs a lot of testing but appears to be working.
To test just checkout the branch and run as usual.
To re-build
js/main-bundle.jsfrom the modules runnpm run buildfrom the root directory.To unpack the modules from the old minified code again
js/main-unminified.jsand put it inscripts/_old_main_packed_modules.jsnote: If you look carefully this whole ~150K line array is an argument to a function, so I can't think of a clean way to grab it from the script without more sophisticated (and error pone) parsing. Alternatively, if this branch is going to live for more than a week or so we could just adjustjs/main-unminified.jsto pop that array out into a field in the file and then I could safely get at it from the script. Since this is a one-time thing though I think it is just as easy to just manually extract it.scripts, runnode unpack_modules.js(it unpacks fromscripts/_old_main_packed_modules.js)scripts/unpacked_modules/main.jsthere is onerequire('../server/utility.js')that needs converted torequire('./server/utility.js')cp -r scripts/unpacked_modules/* js/js/main-bundle.jsby runningnpm run buildfrom the root directoryThis is a one-time thing so we shouldn't need the script or to re-run this unless we need it for some merges before this gets merged.
activescott included the following code: https://github.com/forkdelta/forkdelta.github.io/pull/131/commits