2

How to manually set the path of //# sourceMappingURL inside the created bundle.js? Parcel currently creates a wrong path to the bundle.js.map.

Parcel config:

"scripts": {    
  "watch:js": "parcel watch ./src/js/index.js --out-dir ./public/js --out-file bundle.js",
}

Current Behavior:

 ~ bundle.js ~    

//# sourceMappingURL=/bundle.js.map

Expected Behavior:

~ bundle.js ~    

//# sourceMappingURL=/js/bundle.js.map

1 Answer 1

3

One simple workaround is to add the following flag to your call to parcel, which will make the source-map URL relative to the JS file it maps, rather than an absolute.

--public-url ./

See this GitHub issue for more information.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.