-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] conditional compilation for SES compatibility #133
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.cjs
Conditional compilation, so this can be used in ffjavascript to conditional compile Worker related code.
See the ffjavascipt PR here: iden3/ffjavascript#32