-
Notifications
You must be signed in to change notification settings - Fork 3
"Unexpected token" while compiling with Sass #23
Comments
Can you try this config: import litcss from "rollup-plugin-lit-css";
import styles from "rollup-plugin-styles";
import typescript from "@rollup/plugin-typescript";
const distFolder = "dist";
export default [
{
input: ["index.ts"],
output: {
file: `${distFolder}/index.js`,
format: "es",
sourcemap: true,
},
mimeTypes: {
"src/*.scss": "js"
},
plugins: [
styles({
mode: "emit",
minimize: true,
}),
litcss({
include: ["src/*.scss"],
}),
typescript(),
],
},
]; |
side note, you might like to try out |
With the config above I end up with the same error and a warning provided by rollup:
|
ahh my bad I had assumed this was your dev server config. I have to assume this is a problem with rollup-plugin-styles. this package is extremely simple, it just takes a css string and outputs it as a js file. Have you tried editing this plugin's files in |
Description
Combining
rollup-plugin-lit-css
androllup-plugin-styles
produces an "Unexpected token" error when mode is set toemit
.Reproduction
You can use the combination of the following files to reproduce this. If you'd prefer this in a different format please let me know.
rollup.config.js
index.ts
src/MyComponent.ts
src/MyComponent.scss
Workaround
You can workaround this by omitting
litcss()
and leveraging thecss
andunsafeCSS
imports from lit-element.The text was updated successfully, but these errors were encountered: