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

Added parserOptions option #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Added parserOptions option #1

wants to merge 5 commits into from

Conversation

51ck
Copy link

@51ck 51ck commented Feb 2, 2022

Hi there!

Today I have faced an issue:

[!] (plugin rename-rollup) SyntaxError: Unexpected token (row:column)
undefined (row:column)
SyntaxError: Unexpected token (row:column)
    at Parser.pp$4.raise (/project/node_modules/rollup/dist/shared/rollup.js:19613:13)
    at Parser.pp$9.unexpected (/project/node_modules/rollup/dist/shared/rollup.js:16908:8)
    at Parser.pp$5.parseIdent (/project/node_modules/rollup/dist/shared/rollup.js:19544:10)
    at Parser.pp$5.parsePropertyName (/project/node_modules/rollup/dist/shared/rollup.js:19347:109)
    at Parser.pp$5.parseProperty (/project/node_modules/rollup/dist/shared/rollup.js:19274:8)
    at Parser.pp$5.parseObj (/project/node_modules/rollup/dist/shared/rollup.js:19228:21)
    at Parser.pp$5.parseExprAtom (/project/node_modules/rollup/dist/shared/rollup.js:18963:17)
    at Parser.pp$5.parseExprSubscripts (/project/node_modules/rollup/dist/shared/rollup.js:18779:19)
    at Parser.pp$5.parseMaybeUnary (/project/node_modules/rollup/dist/shared/rollup.js:18745:17)
    at Parser.pp$5.parseExprOps (/project/node_modules/rollup/dist/shared/rollup.js:18672:19)
    at Parser.pp$5.parseMaybeConditional (/project/node_modules/rollup/dist/shared/rollup.js:18655:19)
    at Parser.pp$5.parseMaybeAssign (/project/node_modules/rollup/dist/shared/rollup.js:18622:19)
    at Parser.pp$8.parseVar (/project/node_modules/rollup/dist/shared/rollup.js:17451:24)
    at Parser.pp$8.parseVarStatement (/project/node_modules/rollup/dist/shared/rollup.js:17315:8)
    at Parser.pp$8.parseStatement (/project/node_modules/rollup/dist/shared/rollup.js:17063:17)
    at Parser.pp$8.parseBlock (/project/node_modules/rollup/dist/shared/rollup.js:17384:21)

The reason is ecmaVersion here:

const ast = this.parse(file.code, {
    ecmaVersion: 6,
    sourceType: 'module',
});

Proposal: make an option to pass the parser config

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