-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat: add integrity
flag support
#2571
Conversation
@guybedford i started looking into this, and the tests are failing from the usage of const source = await fs.readFile(resolvedModule.target, { encoding: "utf8" });
const babel = await import("@babel/core");
try {
babel.parse(source);
return resolvedModule; // this is a javascript module, it parsed correctly
} catch (e) {
/* fallback to parsing it as html */
} https://github.com/jspm/jspm-cli/blob/main/src/link.ts#L130 But seems there is no It passes if its changed to named-import here. But then the tracer from export async function createCjsAnalysis(
imports: any,
source: string,
url: string
): Promise<Analysis> {
if (!babel) ({ default: babel } = await import("@babel/core"));
const requires = new Set<string>();
const lazy = new Set<string>();
const unboundGlobals = new Set<string>();
babel.transform(source, {
ast: false,
sourceMaps: false, https://github.com/jspm/generator/blob/main/src/trace/cjs.ts#L24 The one from the generators seems to pass because the project is built using rollup there. And i suspect the behaviour in both the places is little different. Should we switch to named-imports in both the places. Any inputs fro this ? |
@JayaKrishnaNamburu thanks for looking into this. I've pushed a fix for Babel, is it working now for you? You may need to clear your browser cache. |
@guybedford the fix for jspm is working good now. Should we switch to |
Yes, let's update the generator to use named exports now then? |
cool, will update the PR here and make on on the generator for the same 👍 |
Let me know if I can help further on this PR at all. |
integrity
flag support
Updates to the latest generator.