You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import { sass } from 'svelte-preprocess-sass';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/bundle.js'
},
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
preprocess: {
style: sass({indentedSyntax: true}),
},
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
css.write('public/bundle.css');
}
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve(),
commonjs(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
};
Error message:
Error: Invalid CSS after "": expected 1 selector or at-rule, was "global(h1): {"
Any suggestions for how to fix this issue?
The text was updated successfully, but these errors were encountered:
elliotwaite
changed the title
Using the :global(...) css selector causes an error when using Sass's indented syntax.
Using the :global(...) CSS selector causes an error when using Sass's indented syntax.
Jun 1, 2019
This doesn't sound like an issue with Svelte. I skimmed the linked svelte-preprocess-sass issue, and it sounds like the syntax just isn't valid indented sass. What specifically are you suggesting should happen?
Trying to use the css global selector (
:global(...)
) causes a syntax error when trying to use Sass's indented syntax.Here is the code to reproduce the issue (adapted from the sveltejs/template).
App.svelte:
Then this was added to rollup.config.js:
The full rollup.config.js:
Error message:
Any suggestions for how to fix this issue?
The text was updated successfully, but these errors were encountered: