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

Production mode #516

Closed
labnol opened this issue Mar 19, 2021 · 6 comments · Fixed by #521
Closed

Production mode #516

labnol opened this issue Mar 19, 2021 · 6 comments · Fixed by #521
Assignees

Comments

@labnol
Copy link

labnol commented Mar 19, 2021

I noticed an issue with the production mode. The top-level function is not added to the output if the global function calls another method that is imported from another folder.

I tried to replicate the structure here if that explains it better. https://codesandbox.io/s/mystifying-mestorf-8dfec?file=/src/index.js

@labnol
Copy link
Author

labnol commented Mar 20, 2021

Update: The problem disappears if the mode is set to 'none' in webpack configuration.

@fossamagna fossamagna self-assigned this Mar 23, 2021
@fossamagna
Copy link
Owner

@labnol Thank you.
I consider that this issue occur using production mode and using ES Module.
I still want to find the cause based on the source code you provided.

@labnol
Copy link
Author

labnol commented Mar 23, 2021

Please see this test repo. The top-level function is not generated when the mode is production but works for 'none' - thanks!

@labnol
Copy link
Author

labnol commented Mar 23, 2021

Found another issue I guess. This doesn't work.

const fnName = "hello";
global[fnName] = () => console.log("do something..");

@fossamagna
Copy link
Owner

@labnol issue for Property accessors is moved #520

@fossamagna
Copy link
Owner

@labnol A new version is now available. Try it out.
https://www.npmjs.com/package/gas-webpack-plugin/v/2.0.1

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

Successfully merging a pull request may close this issue.

2 participants