New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-sass-modules

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-sass-modules - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/index.d.mts

2

lib/loadStylesheet.d.ts

@@ -1,2 +0,2 @@

export default function loadStylesheet(css: string): void;
export default function loadStylesheet(css: any): void;
//# sourceMappingURL=loadStylesheet.d.ts.map

@@ -6,1 +6,2 @@ export default function loadStylesheet(css) {

}
//# sourceMappingURL=loadStylesheet.js.map
{
"name": "esbuild-plugin-sass-modules",
"version": "0.0.1",
"description": "Plugin for esbuild to support SASS styles usiing css modules.",
"main": "lib/index.js",
"type": "module",
"version": "0.0.2",
"description": "Plugin for esbuild to support SASS styles using css modules.",
"main": "lib/index.mjs",
"types": "lib/index.d.ts",
"scripts": {
"start": "tsc --watch",
"build": "rm -rf lib && tsc",
"build": "rimraf lib && tsc",
"test": "npm run all build test:*"

@@ -25,35 +24,19 @@ },

"plugin",
"sass"
"sass",
"modules"
],
"dependencies": {
"@ms-cloudpack/get-package": "^0.0.1",
"css-tree": "^1.1.2",
"fs-extra": "^9.0.1",
"autoprefixer": "^10.4.0",
"postcss": "^8.4.0",
"postcss-modules": "^4.2.2",
"sass": "^1.34.1"
},
"devDependencies": {
"@types/css-tree": "^1.0.5",
"@types/fs-extra": "^9.0.8",
"@types/node": "^14.14.35",
"@types/sass": "^1.16.0",
"@types/tmp": "^0.2.0",
"esbuild": "^0.12.6",
"husky": "^4.3.7",
"lint-staged": "^10.5.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"tap-spec": "^5.0.0",
"tape": "^5.1.1",
"typescript": "^4.2.3"
},
"husky": {
"hooks": {
"pre-commit": "npx lint-staged"
}
},
"lint-staged": {
"*.js": [
"npx prettier --write"
]
"typescript": "^4.5.2",
"jest": "27.3.1"
}
}

@@ -1,16 +0,7 @@

# esbuild-plugin-sass-modules
# esbuild-plugin-sass
![Node.js CI](https://github.com/dzearing/esbuild-plugin-sass-modules/workflows/Node.js%20CI/badge.svg)
![Node.js CI](https://github.com/koluch/esbuild-plugin-sass/workflows/Node.js%20CI/badge.svg)
Plugin for [esbuild](https://esbuild.github.io/) to support SASS modules
Plugin for [esbuild](https://esbuild.github.io/) to support SASS styles
## What this plugin supports
- Provides a default javascript-based css loader implementation. Just import css or scss in your code, and it will be loaded through Javascript.
- Compiles your global .sass files into css.
- Compiles your `*.module.css` files into css + class map.
- Compiles your `*.module.scss` files into css + class map.
- Produces .d.ts typings for modules, so that you get intellisense and build validation.
- Resolves `@import '~package/path.scss'` package imports.
## Install

@@ -22,16 +13,2 @@

In your esbuild config:
```
import sassPlugin from 'esbuild-plugin-sass-modules';
esbuild.build({
// ...,
plugins: [
sassPlugin()
]
})
```
## Usage example

@@ -52,19 +29,18 @@

```js
import "./test.scss";
import './test.scss'
```
Create file `build.js`:
```js
const esbuild = require("esbuild");
const sassPlugin = require("esbuild-plugin-sass");
const esbuild = require('esbuild');
const sassPlugin = require('esbuild-plugin-sass')
esbuild
.build({
entryPoints: ["src/index.js"],
esbuild.build({
entryPoints: ['src/index.js'],
bundle: true,
outfile: "bundle.js",
outfile: 'bundle.js',
plugins: [sassPlugin()],
})
.catch((e) => console.error(e.message));
}).catch((e) => console.error(e.message))
```

@@ -85,9 +61,1 @@

```
## Why this plugin?
I built this plugin to ensure we have proper support for SASS, SASS modules, and CSS modules in one plugin. Having one plugin, rather than chaining multiple plugins together, has the benefit of reducing the amount of disk I/O and performance overhead of esbuild calling into JavaScript extraneously.
- Better performance
- Simplicity for the dev; no need to chain
- Able to resolve sass from other packages

Sorry, the diff of this file is not supported yet

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