Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Incomplete sourcemap: source file missing #88

Open
undecaf opened this issue Aug 29, 2020 · 0 comments
Open

Incomplete sourcemap: source file missing #88

undecaf opened this issue Aug 29, 2020 · 0 comments

Comments

@undecaf
Copy link

undecaf commented Aug 29, 2020

Description

I am building an ES6 module library with multiple Vue components using rollup and rollup-plugin-terser. Unfortunately, the generated .map file is missing at least one source file. This appears similar to #72 .

Why do I think this is an issue of rollup-plugin-terser?

If I run rollup without terser then the .map file is complete (and the .js is not compressed). Running terser from the command line on these files creates the expected result: a compressed .js file and a complete .map file.

How to reproduce

I have prepared a minimal project demonstrating this issue. Download, unzip and run npm install.

Uncomment terser() in rollup.config.js and npm run build. This builds a library of two simple Vue components (<comp-main> and <comp-aux>) in dist/components.esm.js. Only comp-aux.vue shows up in the sourcemap sources property.

Building a correct sourcemap: remove terser() from rollup.config.js, npm run build and then npm run terser. Now the sourcemap sources property contains both comp-main.vue and comp-aux.vue.

Workaround

Remove terser() from rollup.config.js and run terser automatically after building. This is done by just removing the leading '_' from "_postbuild" in package.json.

undecaf added a commit to undecaf/vue-material-vuelidate that referenced this issue Aug 29, 2020
undecaf added a commit to undecaf/vue-material-vuelidate that referenced this issue Sep 1, 2020
undecaf added a commit to undecaf/vue-hotkey that referenced this issue Sep 12, 2020
undecaf added a commit to undecaf/vue-autofocus that referenced this issue Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant