esbuild-plugin-sass
Plugin for esbuild to support SASS styles
Install
npm i esbuild esbuild-plugin-sass
Usage example
Create file src/test.scss
:
body {
&.red {
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;
}