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

Replace main and specific files together #10

Open
alexleonescalera opened this issue Apr 6, 2017 · 1 comment
Open

Replace main and specific files together #10

alexleonescalera opened this issue Apr 6, 2017 · 1 comment

Comments

@alexleonescalera
Copy link

alexleonescalera commented Apr 6, 2017

I'm not sure if it is possible to replace the main (entry point) file along with specific files (advanced mode). I couldn't find documentation stating if it is possible or not.

This is what I'm looking for:

"main": "index.js",
"browser": {
  "./index.js": "./client-index.js",
  "module-a": "./shims/module-a.js",
  "./lib/server.js": false
}
@RikkiGibson
Copy link

RikkiGibson commented Jun 5, 2018

I was able to make this work by passing the value for my "main" property as the key in the "browser" object. For example:

{
  "main": "./dist/server/entry.js",
  "browser": {
    "./dist/server/specific.js": "./dist/browser/specific.js",
    "./dist/server/entry.js": "./dist/browser/entry.js"
  }
}

I think this is probably intended but it would be good to update the spec to make it clear how to do that.

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