Fix imports
See original GitHub issueThis is an ES6 module, meaning that you can’t just import it in Node and start using it. You have to transpile or use babel-core/register
prior to attempting to import it. Since this is a general-purpose library, I think the right approach is to switch to CommonJS module format, which AFAIK, is supported natively by Node, browserify, webpack, and JSPM, which I think covers all of the most common package managers in use today.
Todo:
- 1.
package.json
needs to point tosource/dsm.js
- 2. Swap out
import
/export
withrequire
/module.exports
. (example). - 3. No build step needed! Compiling for the intended targets is a job for the module users, not for us. We don’t know the intended targets, so we don’t know the right options to build for. If we give them the raw source, it gives users the flexibility and freedom they need to decide things like whether or not they need to bundle a generator runtime, etc…
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Welcome to Python Fix Imports's documentation
Python Fix Imports is a Python module that can automatically reorganize the import statements of your Python script. Please read the “Rationale” section...
Read more >Python Fix Imports - Package Control
Python Fix Imports is a Sublime Text 3 plugin that can automatically reorganize the import statements of your Python script. Please read the...
Read more >fiximports - PyPI
Python Fix Imports is a Python executable that can automatically reorganize the import statements of your Python script, by splitting single import ...
Read more >Automatically "fix imports" in XCode 9? - Apple Developer
With 300 new "automatic fixes" in the XCode 9 editor, i'm puzzled why there is still no "fix imports" function, like in most...
Read more >fiximports (Fix Target Module Imports) - Windows drivers
.fiximports (Fix Target Module Imports). Article; 12/14/2021; 2 minutes to read; 1 contributor. Feedback ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
published
Hmm… I pulled in Babel just for the
import
support. Since we’re using Node 6 for the build, and we’ve switched to CommonJS modules, @Sigmus may be right. I’ve created a new issue to address the removal.