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

rollup 0.52.1 cannot parse tagged template strings in 'rollup.config.js' #1875

Closed
feross opened this issue Jan 15, 2018 · 3 comments
Closed

Comments

@feross
Copy link

feross commented Jan 15, 2018

It looks like rollup 0.52.1 started parsing the rollup.config.js file with buble (in this PR #1759). This breaks my config which is using a tagged template string. Apparently buble does not support these.

[!] (buble plugin) CompileError: Tagged template strings are not supported. Use `transforms: { templateString: false }` to skip transformation and disable this error, or `transforms: { dangerousTaggedTemplateString: true }` if you know what you're doing (40:10)
rollup.config.js (40:10)
36 :       externalHelpers: true
37 :     }),
38 :     commonjs()
39 :   ],
40 :   banner: stripIndent`
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The PR where this was introduced is #1759 which was adding support for object rest/spread. Is it possible to support object rest/spread without breaking other features already supported by modern Node runtimes? Or am I doing something wrong?

@feross feross changed the title rollup 0.52.1 breaks rollup.config.js parsing rollup 0.52.1 cannot parse tagged template strings in 'rollup.config.js' Jan 15, 2018
@lukastaegert
Copy link
Member

As both this issue and #1873 could be easily solved by reverting #1759 I guess that is the way we should go. Maybe as part of the code-splitting release if I find the time. Otherwise, a reverting PR is certainly welcome.

Sorry @haraldrudell who made this PR in the first place. But after all the discussion, my feeling is that going back to what the host system supports is the best and purest solution. You can always just create a simple npm script like

"build": "npx babel rollup.config.js --out-file rollup.config.transpiled.js && rollup -c rollup.config.transpiled.js"

to enable unsupported syntax in the config.

@lukastaegert
Copy link
Member

Should be fixed now

@feross
Copy link
Author

feross commented Feb 16, 2018

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants