Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-sass-plugin

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-sass-plugin

esbuild plugin for sass/scss files supporting both css loader and css result import (lit-element)

  • 3.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
161K
increased by8.39%
Maintainers
1
Weekly downloads
 
Created

What is esbuild-sass-plugin?

The esbuild-sass-plugin is an npm package that integrates Sass/SCSS compilation into the esbuild bundler. It allows developers to seamlessly compile Sass/SCSS files into CSS during the build process, leveraging the speed and efficiency of esbuild.

What are esbuild-sass-plugin's main functionalities?

Basic Sass/SCSS Compilation

This feature allows you to compile Sass/SCSS files into CSS as part of the esbuild process. The code sample demonstrates how to set up esbuild with the esbuild-sass-plugin to bundle JavaScript and compile Sass/SCSS files.

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

esbuild.build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outfile: 'dist/bundle.js',
  plugins: [sassPlugin()]
}).catch(() => process.exit(1));

Custom Sass Options

This feature allows you to pass custom options to the Sass compiler. The code sample shows how to configure the plugin to include additional paths and enable indented syntax for Sass files.

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

esbuild.build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outfile: 'dist/bundle.js',
  plugins: [sassPlugin({
    includePaths: ['./src/styles'],
    indentedSyntax: true
  })]
}).catch(() => process.exit(1));

Source Maps

This feature enables source map generation for easier debugging of Sass/SCSS files. The code sample demonstrates how to configure esbuild to generate source maps along with the compiled CSS.

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

esbuild.build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outfile: 'dist/bundle.js',
  sourcemap: true,
  plugins: [sassPlugin()]
}).catch(() => process.exit(1));

Other packages similar to esbuild-sass-plugin

Keywords

FAQs

Package last updated on 17 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc