Parcel: How do I exclude source map loading of a specific module?

Created on 2 Dec 2018  路  3Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

Using [email protected], run the following bash commands:

mkdir source-map-example
cd source-map-example/
yarn init -y
yarn add [email protected]
echo "import { Auth } from 'aws-amplify';" > index.js
parcel start index.js

You get a string of warnings like:

鈿狅笍 Could not load source file "../src/index.ts" in source map of "node_modules/aws-amplify/lib/index.js".

馃 Expected Behavior

This is expected because that repo includes the source maps, but not the actual source. Is there, however, a way for me to turn off source-map-loading for that module?

馃槸 Current Behavior


I don鈥檛 see an option to set excludes on source map loading.

馃拋 Possible Solution

It appears in webpack, people use the source-map-loader plugin and with that, they can specify something like this:

exclude: '/node_modules/aws-amplify'

馃敠 Context


It just leads to a really noisy console and makes me fearful that I鈥檒l miss actual important warnings or errors.

馃捇 Code Sample

Setup in configuration.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.10.1 |
| Node | v10.11.0 |
| Yarn | 1.6.0 |
| Operating System | Mac OSX 10.13.6 |

Most helpful comment

You could use parcel --log-level 1.
As previously noted, this needs to be fixed by the published package (aws-amplify in this case).

All 3 comments

You could use parcel --log-level 1.
As previously noted, this needs to be fixed by the published package (aws-amplify in this case).

@mischnic Could you link to the "previously noted"?

Sorry to open a closed issue.

It is in reference to the OP Possible Solution section.

Was this page helpful?
0 / 5 - 0 ratings