11# esbuild-sass-modules-plugin
22A sass module loader plugin for esbuild.
33
4- ![ npm package version] ( https://img.shields.io/static/v1?label=%40squirrelnetwork%2Fesbuild-sass-modules-plugin&message=1.0.2 &color=5AA9E6&logo=npm&logoColor=FF6392 )
4+ ![ npm package version] ( https://img.shields.io/static/v1?label=%40squirrelnetwork%2Fesbuild-sass-modules-plugin&message=1.0.3 &color=5AA9E6&logo=npm&logoColor=FF6392 )
55
66This plugin allows .scss and .sass files to be imported as modules in javascript
77files.
88
9+ > Note: this package is a module.
10+
911## Basic usge:
1012
1113``` js
@@ -22,6 +24,30 @@ await esb.build(
2224);
2325```
2426
27+ > Note: if you see an error in console like this:
28+ > ``` js
29+ > node: internal/ process / esm_loader: 94
30+ > internalBinding (' errors' ).triggerUncaughtException (
31+ > ^
32+ >
33+ > Error [ERR_UNSUPPORTED_DIR_IMPORT ]: Directory import ' node_modules\l odash\f p' is not supported resolving ES modules imported from node_modules\@squirrelnetwork\esbuild-sass-modules-plugin\src\esbuild-sass-modules-plugin.class.js
34+ > Did you mean to import lodash/fp.js?
35+ > at new NodeError (node: internal/ errors: 371 : 5 )
36+ > at finalizeResolution (node: internal/ modules/ esm/ resolve: 412 : 17 )
37+ > at moduleResolve (node: internal/ modules/ esm/ resolve: 932 : 10 )
38+ > at defaultResolve (node: internal/ modules/ esm/ resolve: 1044 : 11 )
39+ > at ESMLoader .resolve (node: internal/ modules/ esm/ loader: 422 : 30 )
40+ > at ESMLoader .getModuleJob (node: internal/ modules/ esm/ loader: 222 : 40 )
41+ > at ModuleWrap.< anonymous> (node: internal/ modules/ esm/ module_job: 76 : 40 )
42+ > at link (node : internal / modules / esm / module_job : 75 : 36 ) {
43+ > code: ' ERR_UNSUPPORTED_DIR_IMPORT' ,
44+ > url: ' file:///.../node_modules/lodash/fp'
45+ > }
46+ > ` ` `
47+ > Then you need to
48+ > [add the flag](https://nodejs.org/api/cli.html#cli_experimental_specifier_resolution_mode)
49+ > ` -- experimental- specifier- resolution= node` when running node.
50+
2551## Documentation
2652
2753See the [wiki](https://github.com/Squirrel-Network/esbuild-sass-modules-plugin/wiki/)
0 commit comments