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

Provide require() in console #67

Closed
gaearon opened this issue Jul 22, 2016 · 5 comments
Closed

Provide require() in console #67

gaearon opened this issue Jul 22, 2016 · 5 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Jul 22, 2016

We should figure out a way to provide a global require() in DEV mode in the browser console.
It could be implemented as a webpack plugin (everything is a plugin in webpack right?)

It could work like this:

  • For modules with unique names, require('moduleName') just works
  • For modules with non-unique names, require('./full/path/from/root') is the only way

Still not too bad!

@eanplatter
Copy link
Contributor

What is the use case for this? So I can go to my dev tools console and access a module? That would be helpful, I'd like to dig into it.

@gaearon
Copy link
Contributor Author

gaearon commented Jul 24, 2016

Yea, it's for debugging individual modules when something specific doesn't quite work, and you want to call it directly.

@eanplatter
Copy link
Contributor

screen shot 2016-07-24 at 9 04 53 am

This is freaking handy indeed!

@vjeux
Copy link
Contributor

vjeux commented Jul 24, 2016

You can try it out on facebook.com fyi, it's super useful for debugging

@gaearon
Copy link
Contributor Author

gaearon commented Sep 3, 2016

Closing for a lack of a specific proposal. It’s not clear how this would work with relative imports so unless somebody prototypes this, I likely won’t be working on it.

@gaearon gaearon closed this as completed Sep 3, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants