Skip to content

Commit

Permalink
Merge pull request #135 from elycruz/dev
Browse files Browse the repository at this point in the history
issue-#131 - *.css files support
  • Loading branch information
elycruz authored Jun 25, 2024
2 parents bd552b4 + 53dd484 commit dceef1c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

10 changes: 1 addition & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
.circleci/
.github/
.idea/
.nyc_output/

.editorconfig
.gitignore
.node-version
.npmrc
./.*

CHANGELOG*
CODEOWNERS*
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,32 @@ sass({
})
```

### `include`

+ Type: `string | string[]`
+ Default: `['**/*.sass', '**/*.scss']`

Glob of sass/css files to be targeted.

```ts
sass({
include: ['**/*.css', '**/*.sass', '**/*.scss']
})
```

### `exclude`

+ Type: `string | string[]`;
+ Default: `'node_modules/**'`

Globs to exclude from processing.

```ts
sass({
exclude: 'node_modules/**'
})
```

## License

[MIT](./LICENSE) [elycruz](https://github.com/elycruz),
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ const MATCH_SASS_FILENAME_RE = /\.sass$/,
const moduleUrl = url.slice(1);
const resolveOptions = {
basedir: dirname(prevUrl),
extensions: ['.scss', '.sass'],
extensions: ['.scss', '.css', '.sass'],
};

// @todo This block should run as a promise instead, will help ensure we're not blocking the thread it is running on, even though `sass` is probably already running the importer in one.
// @todo This block should run as a promise instead, will help ensure we're not blocking the thread it is
// running on, even though `sass` is probably already running the importer in one.
try {
const file = resolve.sync(moduleUrl, resolveOptions);
lastResult = lastResult.then(() => done({file}));
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export interface SassFunctionsObject {

/**
* All option types taken from https://github.com/sass/node-sass#options -
* **Note 1:** As noted by dart-sass project "When installed via npm, Dart Sass supports a JavaScript API that's fully compatible with Node Sass (with a few exceptions listed below) ...". See the (dart) sass npm page for more:
* **Note 1:** As noted by dart-sass project "When installed via npm, Dart Sass supports a JavaScript API that's
* fully compatible with Node Sass (with a few exceptions listed below) ...". See the (dart) sass npm page for more:
* https://www.npmjs.com/package/sass
*
* **Note 2:** Our plugin only uses the "legacy" (async) API (internally) so `SassOptions` type below, for now,
Expand Down

0 comments on commit dceef1c

Please sign in to comment.