title: Patching a NPM package locally with patch-package, not working
body: <p>I'm working on a vue.js frontend, and I need to patch a package to fit the special needs of the app. The package I'm trying to patch is '<code>vue-youtube</code>' (not that it really matters). I'm trying to patch it with patch-package (<a href="https://www.npmjs.com/package/patch-package" rel="noreferrer">https://www.npmjs.com/package/patch-package</a>)</p>
  <p>So basically :</p>
  <ul>
  <li>I edited locally the <code>/node_modules/vue-youtube/src/vue-youtube.js</code> to fit my needs</li>
  <li>I did add the postinstall script in my package.json : <code>&quot;scripts&quot;: { &quot;postinstall&quot;: &quot;patch-package&quot; }</code></li>
  <li>I did <code>npm install patch-package --save-dev</code></li>
  <li>Then I ran <code>npx patch-package vue-youtube</code></li>
  <li>It did create a <code>vue-youtube+1.4.0.patch</code> file in a <code>/patches</code> folder with my modifications</li>
  </ul>
  <p><strong>BUT</strong>, my modifications are not seen. When I do <code>npm run serve</code> and launch my webapp, the package used is still the one not edited. I tried running <code>npm install</code> before, without success. When I go to the <code>/node_modules/vue-youtube/dist/vue-youtube.js</code> (thankfully it is a small package so it is readable), I can see that indeed my modifications have not been &quot;<em>compiled</em>&quot;.</p>
  <p>What am I missing here ? I feel like I have followed eveything in the patch-package npm page..</p>
  <p>Thanks</p>
  <p><strong>EDIT :</strong> Still investigating.. few more informations/questions :</p>
  <ul>
  <li>my patch name is <code>patches/vue-youtube+1.4.0.patch</code></li>
  <li>when i run <code>npm ls vue-youtube</code> it returns just one element : <code>vue-youtube@1.4.0</code></li>
  <li>in my <code>package.json</code> the dependency listed is <code>&quot;vue-youtube&quot;: &quot;^1.4.0&quot;</code>, should it be different ? should it mention that it needs to be patched ?</li>
  </ul>
  <p><strong>EDIT 2 :</strong> I realized that I am not editing the <code>node_modules/vue-youtube/dist/vue-youtube.js</code>, but the <code>node_modules/vue-youtube/src/vue-youtube</code>.
  If you edit the files in the dist folder, the patch works. (however I thought patch-package would allow me to edit the files in the src folder, in readable JS...)</p>