Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
242 stars 43 forks source link

SyntaxError with nollup #144

Closed nstepien closed 3 years ago

nstepien commented 3 years ago

https://github.com/PepsRyuu/nollup

My configuration looks like this:

    styles({
      mode: ['extract', 'main.css'],
      autoModules: true,
      minimize: process.env.NODE_ENV === 'production'
    }),

When I run nollup, I get multiple errors that look like this:

SyntaxError: Unexpected token (1:0)
    at Object.pp$4.raise (C:\project\node_modules\acorn\dist\acorn.js:2927:15)
    at Object.pp.unexpected (C:\project\node_modules\acorn\dist\acorn.js:698:10)
    at Object.pp$3.parseExprAtom (C:\project\node_modules\acorn\dist\acorn.js:2326:12)
    at Object.parseExprAtom (C:\project\node_modules\nollup\lib\impl\AcornParser.js:10:30)
    at Object.pp$3.parseExprSubscripts (C:\project\node_modules\acorn\dist\acorn.js:2129:21)
    at Object.pp$3.parseMaybeUnary (C:\project\node_modules\acorn\dist\acorn.js:2106:19)
    at Object.pp$3.parseExprOps (C:\project\node_modules\acorn\dist\acorn.js:2041:21)
    at Object.pp$3.parseMaybeConditional (C:\project\node_modules\acorn\dist\acorn.js:2024:21)
    at Object.pp$3.parseMaybeAssign (C:\project\node_modules\acorn\dist\acorn.js:1997:21)
    at Object.pp$3.parseExpression (C:\project\node_modules\acorn\dist\acorn.js:1963:21) {
  pos: 0,
  loc: Position { line: 1, column: 0 },
  raisedAt: 1
}

SyntaxError: Unexpected character '@' (1:0)
    at Object.pp$4.raise (C:\project\node_modules\acorn\dist\acorn.js:2927:15)
    at Object.pp$9.getTokenFromCode (C:\project\node_modules\acorn\dist\acorn.js:4708:10)
    at Object.pp$9.readToken (C:\project\node_modules\acorn\dist\acorn.js:4409:17)
    at Object.pp$9.nextToken (C:\project\node_modules\acorn\dist\acorn.js:4400:17)
    at Object.parse (C:\project\node_modules\acorn\dist\acorn.js:554:10)
    at Function.parse (C:\project\node_modules\acorn\dist\acorn.js:578:37)
    at Object.parse (C:\project\node_modules\nollup\lib\impl\AcornParser.js:48:23)
    at Object.parse (C:\project\node_modules\nollup\lib\impl\PluginContext.js:143:36)
    at Object.transform (C:\project\node_modules\rollup-plugin-styles\dist\index.js:1353:14)
    at _callAsyncHook (C:\project\node_modules\nollup\lib\impl\PluginLifecycle.js:12:31) {
  pos: 0,
  loc: Position { line: 1, column: 0 },
  raisedAt: 0
}

It doesn't seem to break anything though, but it does flood the console. Looks like it comes from this line: https://github.com/Anidetrix/rollup-plugin-styles/blob/master/src/index.ts#L87 This doesn't happen with rollup-plugin-postcss 👀

nstepien commented 3 years ago

NVM it seems to have been fixed in nollup.