Commit 9f776e15 authored by Millicent Billette's avatar Millicent Billette

FIX: extend compatibility by removing module mention in prod

parent a786a0f4
......@@ -9,6 +9,7 @@ build-and-clean:
- npm install
- npm run postinstall
- npm run build
- npm run prod
artifacts:
untracked: true
paths:
......
......@@ -7,8 +7,4 @@ try{fs.writeFileSync("public/vendors/nacl.js",(fs.readFileSync("public/vendors/n
.replace("(function(nacl) {","var nacl = {};")
.replace("})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));","export {nacl};")
,"utf8");} catch (e) {console.error(e);}
// let js = fs.readFileSync("node_modules/jparticles/production/jparticles.js","utf8");
// js += fs.readFileSync("node_modules/jparticles/production/particle.js","utf8");
// js += fs.readFileSync("main.js","utf8");
// fs.writeFileSync("main.js",js,"utf8");
// fs.writeFileSync("index.html",(fs.readFileSync("index.html","utf8")).replace(/(.*node_modules.*)/g,''),"utf8");
......@@ -6,6 +6,7 @@
"scripts": {
"postinstall": "node build.js",
"build": "rollup public/worker.js --format iife --file public/generated.worker.js && rollup public/main.js --format iife --file public/generated.main.js",
"prod": "node prod.js",
"test": "echo open public/test.html in your browser"
},
"repository": {
......
const fs = require("fs");
change(
`<script type="module" src="main.js"></script>`,
`<script src="generated.main.js"></script>`,
`public/index.html`);
change(
`Worker('generated.worker.js',{type:"module"})`,
`Worker('generated.worker.js')`,
`public/generated.main.js`);
function change(thisString,withThisString,inThisFile) {
try{fs.writeFileSync(inThisFile,(fs.readFileSync(inThisFile,"utf8"))
.replace(thisString,withThisString)
,"utf8");} catch (e) {console.error(e);}
}
......@@ -97,7 +97,6 @@ space::[ _-.]{0,1}
</style>
</a>
</footer>
<!--<script type="module" src="main.js"></script>-->
<script src="generated.main.js"></script>
<script type="module" src="main.js"></script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment