raimohanska / esbuild-plugin-sass

Plugin for esbuild to support SASS styles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esbuild-plugin-sass

Node.js CI

Plugin for esbuild to support SASS styles

Install

npm i esbuild esbuild-plugin-sass

Usage example

Create file src/test.scss:

body {
  &.isRed {
    background: red;
  }
}

Create file src/index.js:

import './test.scss'

Create file build.js:

const esbuild = require('esbuild');
const sassPlugin = require('esbuild-plugin-sass')

esbuild.build({
    entryPoints: ['src/index.js'],
    bundle: true,
    outfile: 'bundle.js',
    plugins: [sassPlugin()],
}).catch((e) => console.error(e.message))

Run:

node build.js

File named bundle.css with following content will be created:

body.isRed {
  background: red;
}

About

Plugin for esbuild to support SASS styles


Languages

Language:JavaScript 87.3%Language:SCSS 12.7%