parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.5k stars 2.27k forks source link

Is there a way to ignore a module? #3631

Closed auxves closed 4 years ago

auxves commented 5 years ago

❔ Question

Is there a way to ignore a module from being bundled?

🔦 Context

I am making a VSCode extension which imports the vscode module. This module is created on-the-fly by VSCode and isn't a real module, so an error is occurs when Parcel tries to bundle it.

Currently, I'm using Webpack externals to ignore it:

module.exports = {
  ...,
  "externals": {
    "vscode": "commonjs vscode"
  }
}

💻 Code Sample

Repository: https://github.com/arnohovhannisyan/vscode-syncify

🌍 Your Environment

Software Version(s)
Parcel 1.12.4
Node 12.11.1
Yarn 1.19.1
Operating System Manjaro Linux
mischnic commented 4 years ago

Duplicate of https://github.com/parcel-bundler/parcel/issues/3305 / https://github.com/parcel-bundler/parcel/issues/144