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-plugin-typescript Unexpected token #56

Open
givanse opened this issue Jul 9, 2019 · 1 comment
Open

rollup-plugin-typescript Unexpected token #56

givanse opened this issue Jul 9, 2019 · 1 comment

Comments

@givanse
Copy link

givanse commented Jul 9, 2019

Adding rollup-plugin-typescript results on:

Unexpected token (Note that you need plugins to import files that are not JavaScript)
        at BroccoliRollup
-~- created here: -~-
    at new Plugin (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli-plugin/index.js:31:32)
    at new BroccoliRollup (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli-rollup/dist/index.js:15:9)
    at rollup (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli-rollup/dist/index.js:10:12)
    at Object.apply (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli-rollup/index.js:9:20)
    at default (/Users/gsilvae/code/broccoli-rollup-typescript/Brocfile.js:10:10)
    at getBuilder (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli/lib/cli.js:174:31)
    at Command.module.exports.program.command.alias.description.option.option.option.option.option.option.option.option.action (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/broccoli/lib/cli.js:123:23)
    at Command.listener (/Users/gsilvae/code/broccoli-rollup-typescript/node_modules/commander/index.js:315:8)
    at emitTwo (events.js:126:13)
    at Command.emit (events.js:214:7)
-~- (end) -~-

Running Rollup alone, with the same config, works fine.

Repo with test case:
https://github.com/givanse/broccoli-rollup-typescript-test-case

@givanse givanse changed the title Adding rollup-plugin-typescript Unexpected token Jul 10, 2019
@givanse
Copy link
Author

givanse commented Jul 10, 2019

Debugged a little and got to this line in Rollup
https://github.com/rollup/rollup/blob/dd00ff5e480cacc368cc34dff7c2f1a3936d8d0f/src/ModuleLoader.ts#L353

In this location, the code has been pushed through the Rollup plugins but the code has not been transformed, code and originalCode are identical. So I guess that is why down the road we get the Unexpected token error.

Based on that, I would think this is a bug within rollup/broccoli-rollup-typescript. However, the error doesn't show up when broccoli-rollup is removed from the equation.

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

1 participant