browserify / browserify/browserify

Using alias and standalone breaks the module.export from entry point

Open
#1,711 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.7k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I have reproduced the bug in this repo
https://github.com/ErikLarsson82/browserify_alias_bug/tree/browserify_only

Using grunt, there is an alias option and from its docs it says
> It's equivalent to require: [ ['./foo.js', {expose: 'foo'} ] ]

In the repo, I instead use this syntax using browserify without grunt:
`browserify app.js -o bundle.js -r react-dom:alias-test -s foo`

I interpret this code as "take react-dom and expose it as alias-test"
Inside the app code, i can indeed `require("alias-test")`

Now, in my entry point I do
`module.exports = "123"`
... but using the alias option the module instead exports react-dom object.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.