Comments (7)
Nah, peerDeps is a mess. It's also most likely being removed eventually: npm/npm#5080
This makes it so that if I need to require regenerator, I have to do require('gulp-regenerator/node_modules/regenerator')
Have regenerator as a direct dependency if you need it: require('regenerator')
from gulp-regenerator.
peerDeps has undesirable edge cases, but until npm has a better way to support plugins, I think it's good enough. Lots of other plugins use it fine. It would be a bigger problem to install regenerator as a direct dependency, as I now have two versions, and both could be wildly different versions!
I'm open to options other than peerDeps, like not even listing the dependency, but I don't see how it's not far worse to have 2 different versions installed.
from gulp-regenerator.
Why do you need this? What's the use-case for needing this plugin and require the same version of regenerator directly?
from gulp-regenerator.
It's core to how regenerator works: it has runtime that I need to import in node. I need to do var wrapGenerator = require("regenerator/runtime/min").wrapGenerator
at the top of each file (automated by a build process, of course).
from gulp-regenerator.
So you use gulp-regenerator to transpile your Node code and then in that code require the runtime?
If so, couldn't you just use the https://github.com/sindresorhus/gulp-regenerator#optionsincluderuntime option?
from gulp-regenerator.
If I did that a copy of the runtime would be prepended on every single node source file, which is not desirable at all (not to mention breaks semantics if the runtime depends on any global state).
from gulp-regenerator.
Ok, it does look like the "right" way to do it is to keep this as a dependency, and after installing plugins run npm dedupe
. I'll try that out from here, thanks.
from gulp-regenerator.
Related Issues (2)
- Support source maps HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-regenerator.