@bdocs/plugin-sass 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,12 +1,16 @@
1
1
  import { BoltdocsPlugin } from "boltdocs";
2
+ import { CSSOptions } from "vite";
2
3
 
3
4
  //#region src/node/index.d.ts
4
- interface SassPluginOptions {
5
- additionalData?: string;
5
+ type ViteSassOptions = NonNullable<NonNullable<CSSOptions['preprocessorOptions']>['scss']>;
6
+ type SassCompilerOptions = Omit<ViteSassOptions, 'additionalData' | 'api' | 'includePaths' | 'loadPaths'>;
7
+ /** Options shared by Vite's `.scss` and indented `.sass` preprocessors. */
8
+ type SassPluginOptions = SassCompilerOptions & {
9
+ additionalData?: ViteSassOptions['additionalData'];
6
10
  api?: 'modern' | 'modern-compiler' | 'legacy';
7
- loadPaths?: string[];
11
+ loadPaths?: string[]; /** Alias for `loadPaths`; kept for the legacy Sass API. */
8
12
  includePaths?: string[];
9
- }
13
+ };
10
14
  declare function sassPlugin(options?: SassPluginOptions): BoltdocsPlugin;
11
15
  //#endregion
12
16
  export { SassPluginOptions, sassPlugin as default, sassPlugin };
package/dist/index.mjs CHANGED
@@ -1,23 +1,21 @@
1
1
  import { createPlugin } from "boltdocs";
2
2
  //#region src/node/index.ts
3
3
  function sassPlugin(options = {}) {
4
- const { additionalData, api = "modern", loadPaths, includePaths } = options;
4
+ const { additionalData, api = "modern", loadPaths, includePaths, ...compilerOptions } = options;
5
5
  const resolvedLoadPaths = loadPaths ?? includePaths;
6
6
  const pathOptions = api === "legacy" ? resolvedLoadPaths ? { includePaths: resolvedLoadPaths } : {} : resolvedLoadPaths ? { loadPaths: resolvedLoadPaths } : {};
7
+ const preprocessorOptions = {
8
+ ...compilerOptions,
9
+ api,
10
+ ...additionalData !== void 0 ? { additionalData } : {},
11
+ ...pathOptions
12
+ };
7
13
  return createPlugin({
8
14
  name: "plugin-sass",
9
15
  version: "1.0.0",
10
16
  css: { preprocessorOptions: {
11
- scss: {
12
- api,
13
- ...additionalData ? { additionalData } : {},
14
- ...pathOptions
15
- },
16
- sass: {
17
- api,
18
- ...additionalData ? { additionalData } : {},
19
- ...pathOptions
20
- }
17
+ scss: preprocessorOptions,
18
+ sass: preprocessorOptions
21
19
  } }
22
20
  });
23
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bdocs/plugin-sass",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "SASS / SCSS preprocessor plugin for Boltdocs",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -18,15 +18,15 @@
18
18
  "sass-embedded": "^1.85.0"
19
19
  },
20
20
  "peerDependencies": {
21
- "vite": "^7.0.0 || ^8.0.0",
22
- "boltdocs": "^3.3.0"
21
+ "vite": "^8.1.0",
22
+ "boltdocs": "^3.3.6"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.0.0",
26
26
  "tsdown": "^0.21.7",
27
27
  "typescript": "^5.9.3",
28
28
  "vitest": "^3.0.0",
29
- "boltdocs": "^3.3.0",
29
+ "boltdocs": "^3.3.6",
30
30
  "tsdown-config": "1.0.0"
31
31
  },
32
32
  "scripts": {