How to npm publish specific folder but as package root
<p>I have a project that include a gulp task for building and packaging the sources and release in a directory called <code>dist</code>. My goal is publish it as a npm package, but only my dist folder. The <a href="https://docs.npmjs.com/files/package.json" rel="noreferrer">npm documentation</a> says that I can use the <code>files</code> tag to specify files to export. It works. But, documentation also says that:</p>

<blockquote>
  <p>If you name a folder in the array, then it will also include the files
  inside that folder</p>
</blockquote>

<p>The result, is a npm package, which node_modules looks like:</p>

<p><a href="https://i.stack.imgur.com/qWzv7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qWzv7.png" alt="generated npm package"></a></p>

<p>But I'd like to see all my files at the package's root (without that <code>dist</code> folder). My <code>index.js</code> file is inside the <code>dist</code> folder, but should be at root. I've tried to set tag <code>files</code> as <code>/dist/**/*</code> but it didn't work.</p>

<p>How can I achieve it?</p>