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

Viewed 296

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?

1 Answers

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.

Related