How to use svelte-preprocess-sass - 4 common examples

To help you get started, we’ve selected a few svelte-preprocess-sass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nikku / camunda-playground / packages / client / rollup.config.js View on Github external
},
  plugins: [
    url({
      limit: 3 * 1024
    }),
    svelte({
      // enable run-time checks when not in production
      dev: !production,
      immutable: true,
      // we'll extract any component CSS out into
      // a separate file — better for performance
      css: css => {
        css.write(`${distDir}/bundle.css`, !production);
      },
      preprocess: {
        style: sass({
          includePaths: [
            'src/style',
            'node_modules'
          ]
        }, { name: 'scss' }),
        script: scriptProcessor([
          classProcessor(),
          emitProcessor()
        ])
      }
    }),

    // 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:
github kazzkiq / svelte-simple-starter-kit / rollup.config.js View on Github external
historyApiFallback: true,
      port: 5100,
      verbose: true,
    }),
    svelte({
      // enable run-time checks when not in production
      dev: !production,

      // we'll extract any component CSS out into
      // a separate file — better for performance
      css: css => {
        css.write('public/bundle.css');
      },

      preprocess: {
        style: sass(),
      },

      // enable https://svelte.technology/guide#state-management
      store: true,

      // this results in smaller CSS files
      cascade: false,
    }),

    // 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(),
github ItalyPaleAle / hereditas / app / webpack.config.js View on Github external
{
                    test: /\.(html|svelte)$/,
                    exclude: [
                        /main\.html/
                    ],
                    use: {
                        loader: 'svelte-loader',
                        options: {
                            skipIntroByDefault: true,
                            nestedTransitions: true,
                            emitCss: true,
                            hotReload: true,

                            // Preprocess SASS/SCSS
                            preprocess: {
                                style: sass({}, {name: 'scss'})
                            }
                        }
                    }
                },
                {
                    test: /\.css$/,
                    use: [
                        // MiniCssExtractPlugin doesn't support HMR.
                        // For developing, use 'style-loader' instead
                        prod ? MiniCssExtractPlugin.loader : 'style-loader',
                        'css-loader'
                    ]
                },
                {
                    test: /\.scss$/,
                    use: [
github NOtherDev / whatwebcando / _new / rollup.config.js View on Github external
import svelte from 'rollup-plugin-svelte';
import babel from 'rollup-plugin-babel';
import {terser} from 'rollup-plugin-terser';
import config from 'sapper/config/rollup.js';
import {sass} from 'svelte-preprocess-sass';
import pkg from './package.json';

const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const legacy = !!process.env.SAPPER_LEGACY_BUILD;

const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning);
const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/');

const preprocess = {
  style: sass({includePaths: ['src', 'node_modules']}, {name: 'scss'})
}

export default {
  client: {
    input: config.client.input(),
    output: config.client.output(),
    plugins: [
      replace({
        'process.browser': true,
        'process.env.NODE_ENV': JSON.stringify(mode)
      }),
      svelte({
        dev,
        hydratable: true,
        emitCss: true,
        preprocess,

svelte-preprocess-sass

Svelte preprocessor for sass

MIT
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis

Popular svelte-preprocess-sass functions