[feature] conditional compilation for SES compatibility#133
[feature] conditional compilation for SES compatibility#133veronicaz41 wants to merge 4 commits intoiden3:masterfrom
Conversation
|
cc @phated FYI, this works for us |
| import replace from "@rollup/plugin-replace"; | ||
|
|
||
| const pkg = JSON.parse(fs.readFileSync("./package.json")); | ||
| delete pkg.dependencies["ejs"]; |
There was a problem hiding this comment.
have to remove ejs, because this line is not SES compatible: https://github.com/mde/ejs/blob/main/lib/ejs.js#L109
There was a problem hiding this comment.
That shouldn't be how this works. These are marking the dependency as "external" so it isn't put into the bundle. When you delete it from this, it will actually be included.
There was a problem hiding this comment.
this worked us because it removed the var ejs = require('ejs'); from main.ese.cjs.
and the metamask uses browserify to package all this.
but yeah, we should talk before you merge any of my PRs.
| import replace from "@rollup/plugin-replace"; | ||
|
|
||
| const pkg = JSON.parse(fs.readFileSync("./package.json")); | ||
| delete pkg.dependencies["ejs"]; |
There was a problem hiding this comment.
have to remove ejs, because this line is not SES compatible: https://github.com/mde/ejs/blob/main/lib/ejs.js#L109
Add a new ses build
./build/main.ses.cjsConditional compilation, so this can be used in ffjavascript to conditional compile Worker related code.
See the ffjavascipt PR here: iden3/ffjavascript#32