Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: bundle-source generates invalid bundle #1281

Closed
kumavis opened this issue Jul 10, 2020 · 2 comments · Fixed by #1320
Closed

bug: bundle-source generates invalid bundle #1281

kumavis opened this issue Jul 10, 2020 · 2 comments · Fixed by #1320
Labels
bug Something isn't working bundle-source package: bundle-source

Comments

@kumavis
Copy link
Contributor

kumavis commented Jul 10, 2020

Describe the bug
bundle-source creates an invalid bundle when transforming the below text

// below is the bad voodoo
//         */
// above is the bad voodoo

the javascript is transformed into the following invalid code with error
SyntaxError: Unexpected token '*'

"(function getExport(require, exports) {   'use strict';   const module = { exports };     

'use strict'; /* below is the bad voodoo*/ /* */*/ /* above is the bad voodoo*/
  return module.exports;
})
//# sourceURL=/bundled-source/bug.js

this can be found in the zlib package of
rollup-plugin-node-builtins, specifically here

@kumavis kumavis added the bug Something isn't working label Jul 10, 2020
@warner warner added the bundle-source package: bundle-source label Jul 20, 2020
@warner
Copy link
Member

warner commented Jul 20, 2020

cc @michaelfig
I wonder if this is coming from rollup, or from something we've added on top of it (the tildot or metering transforms).

@michaelfig
Copy link
Member

It's the bundle-source comment transform: needs to, e.g. value = value.replace(/\*\//g, '*X/') when converting comment contents into block comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundle-source package: bundle-source
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants