Force include node_modules in package?

Viewed 212

I want to npm publish my dist dir that looks like this:

dist
├── README.md
├── node_modules
│   └── clap
│       └── dist
│           └── es
│               ├── index.js
│               └── index.js.map
├── package.json
...
    └── utils
        ├── memory-stream.js
        ├── memory-stream.js.map
        ├── mysql-users.js
        ├── mysql-users.js.map
        ├── sql.js
        ├── sql.js.map
        ├── utils.js
        └── utils.js.map

Notice how there's a node_modules dir in there. I want to publish that along with everything else.

The files in there are compiled, but they're part of a local package not distributed on npm, so I do want it bundled.

My code references it like this:

var index = require('../node_modules/clap/dist/es/index.js');

So it should work perfectly fine.

The problem is that it looks like npm publish has it hardcoded to ignore directories called node_modules. Is there any way to override that behaviour?

0 Answers
Related