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

Removing Node dependencies when bundling fengari for the browser #3894

Open
flowtsohg opened this issue Dec 9, 2019 · 0 comments
Open

Removing Node dependencies when bundling fengari for the browser #3894

flowtsohg opened this issue Dec 9, 2019 · 0 comments

Comments

@flowtsohg
Copy link

flowtsohg commented Dec 9, 2019

🙋 feature request

Better support for fengari bundling for the browser.

🤔 Expected Behavior

When bundling for the browser, I expect node modules such as fs not to be bundled.

😯 Current Behavior

Such modules are bundled and waste time and size.

💁 Possible Solution

fengari uses the following condition:

if (typeof process === 'undefined') {
 // browser
} else {
 // node
}

This doesn't support webpack or parcel properly, however in webpack it can be solved by defining the following:

new webpack.DefinePlugin({
  'typeof process': JSON.stringify('undefined'),
})

Would love a solution for parcel.

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

No branches or pull requests

2 participants