Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'master' of github.com:elycruz/rollup-plugin-sass into dev #121

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-sass",
"version": "1.12.20",
"version": "1.12.21",
"description": "Rollup Sass files.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export = function plugin(options = {} as RollupPluginSassOptions): RollupPlugin
include = defaultIncludes,
exclude = defaultExcludes,
runtime: sassRuntime,
options: incomingSassOptions = {}
options: incomingSassOptions = {} as SassOptions
} = pluginOptions,

filter = createFilter(include || '', exclude || ''),
Expand Down
35 changes: 14 additions & 21 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {types} from 'sass';
import {LegacyOptions, types} from 'sass';

export interface IdAndContentObject {
id?: string,
Expand Down Expand Up @@ -58,37 +58,30 @@ export type SassImporterResult = { file: string } | { contents: string } | Error
export type SassDoneFn<T extends SassImporterResult = SassImporterResult> =
(result: T) => void | T;

/**
* @deprecated - Use types directly from `sass` package instead.
*/
export type SassImporter<T extends SassImporterResult = SassImporterResult> =
(url: string, prev: string, done: SassDoneFn<T>) => void | T;

/**
* @deprecated - Use types directly from `sass` package instead.
*/
export interface SassFunctionsObject {
[index: string]: types.Color | types.Number | types.String | types.List | types.Map | types.Null;
}

/**
* All option types taken from https://github.com/sass/node-sass#options -
* **Note:** 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,
* is the legacy type.
*
* @todo Update this if/when we update to the new sass API.
*/
export interface SassOptions {
data?: string,
file?: string,
functions?: SassFunctionsObject,
importer?: SassImporter | SassImporter[],
includePaths?: string[],
indentType?: 'space' | 'tab',
indentWidth?: number,
indentedSyntax?: boolean,
linefeed?: string,
omitSourceMapUrl?: boolean,
outFile?: string,
outputStyle?: 'compressed' | 'expanded',
sourceMapContents?: boolean,
sourceMapEmbed?: boolean,
sourceMapRoot?: string,
sourceMap?: boolean | string | undefined
}
export type SassOptions = LegacyOptions<'async'>;

/**
* Rollup's `AssetInfo` bundle type.
Expand Down
Loading