Skip to content
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

require need add current runtime's parser options #78

Open
pkujhd opened this issue May 8, 2024 · 4 comments
Open

require need add current runtime's parser options #78

pkujhd opened this issue May 8, 2024 · 4 comments

Comments

@pkujhd
Copy link

pkujhd commented May 8, 2024

when require a javascript file with source map lint, but source map is not exists, the require failed.

maybe add a option to disable source map

@pkujhd pkujhd changed the title require not have a option to disable source map require need an option to disable source map May 8, 2024
@dop251
Copy link
Owner

dop251 commented May 16, 2024

@pkujhd
Copy link
Author

pkujhd commented May 17, 2024

Such option already exists: https://pkg.go.dev/github.com/dop251/goja#example-Runtime.SetParserOptions

@dop251
yeah, but it doesn't work for require.
in RequireModule.loadModuleFile call Registry.getCompiledSource
It does not access current environment options for parse javascript file.

@dop251
Copy link
Owner

dop251 commented Jun 3, 2024

There should be a way to specify parser options for a Registry. I would consider a PR. Also, I think missing source maps should not be a fatal error (I believe it's not in node).

@pkujhd pkujhd changed the title require need an option to disable source map require need add current runtime's parser options Jun 4, 2024
@pkujhd
Copy link
Author

pkujhd commented Jun 4, 2024

There should be a way to specify parser options for a Registry. I would consider a PR. Also, I think missing source maps should not be a fatal error (I believe it's not in node).

ok, thx, wait for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants