@bdocs/plugin-sass 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Boltdocs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ import { BoltdocsPlugin } from "boltdocs";
2
+
3
+ //#region src/node/index.d.ts
4
+ interface SassPluginOptions {
5
+ additionalData?: string;
6
+ api?: 'modern' | 'modern-compiler' | 'legacy';
7
+ loadPaths?: string[];
8
+ includePaths?: string[];
9
+ }
10
+ declare function sassPlugin(options?: SassPluginOptions): BoltdocsPlugin;
11
+ //#endregion
12
+ export { SassPluginOptions, sassPlugin as default, sassPlugin };
package/dist/index.mjs ADDED
@@ -0,0 +1,25 @@
1
+ import { createPlugin } from "boltdocs";
2
+ //#region src/node/index.ts
3
+ function sassPlugin(options = {}) {
4
+ const { additionalData, api = "modern", loadPaths, includePaths } = options;
5
+ const resolvedLoadPaths = loadPaths ?? includePaths;
6
+ const pathOptions = api === "legacy" ? resolvedLoadPaths ? { includePaths: resolvedLoadPaths } : {} : resolvedLoadPaths ? { loadPaths: resolvedLoadPaths } : {};
7
+ return createPlugin({
8
+ name: "plugin-sass",
9
+ version: "1.0.0",
10
+ css: { preprocessorOptions: {
11
+ scss: {
12
+ api,
13
+ ...additionalData ? { additionalData } : {},
14
+ ...pathOptions
15
+ },
16
+ sass: {
17
+ api,
18
+ ...additionalData ? { additionalData } : {},
19
+ ...pathOptions
20
+ }
21
+ } }
22
+ });
23
+ }
24
+ //#endregion
25
+ export { sassPlugin as default, sassPlugin };
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@bdocs/plugin-sass",
3
+ "version": "0.0.1",
4
+ "description": "SASS / SCSS preprocessor plugin for Boltdocs",
5
+ "main": "./dist/index.mjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.mts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.mts",
11
+ "import": "./dist/index.mjs"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "sass-embedded": "^1.85.0"
19
+ },
20
+ "peerDependencies": {
21
+ "vite": "^7.0.0 || ^8.0.0",
22
+ "boltdocs": "^3.3.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22.0.0",
26
+ "tsdown": "^0.21.7",
27
+ "typescript": "^5.9.3",
28
+ "vitest": "^3.0.0",
29
+ "boltdocs": "^3.3.0",
30
+ "tsdown-config": "1.0.0"
31
+ },
32
+ "scripts": {
33
+ "build": "tsdown --config-loader unrun",
34
+ "dev": "tsdown --watch --config-loader unrun",
35
+ "test": "vitest run"
36
+ }
37
+ }