简体   繁体   中英

Should i put my library dependencies into devDependencies if I only publish the bundle of the library?

If i generate a bundle of a library, should I put the library dependencies in devDependencies ?

I'm authoring a NPM library written in TypeScript which uses a quite amount of dependencies, such as React components. We do some build steps to compile down to JavaScript files, apply minification and bundle into a single JS file. The final published package for this library will contain just a JS file, the output of this build steps.

When I install the package all the dependencies of this library will be installed as well. Should I put those libraries as devDependencies instead in the package.json, given that they are not needed because the JS file will already bundle them?

Not sure about the way you build.

Not needed to put all devdependencies if it is already part of the js file.

If it is going to be only a js file, it can be hosted as CDN file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM