generated from DenoPlayground/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
import sassPlugin from './src/index.ts'; | ||
|
||
export default sassPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Plugin as ESBuildPlugin } from "https://deno.land/x/[email protected]/mod.js"; | ||
import sassPluginSetup from "./sass_plugin_setup.ts"; | ||
import { Plugin as ESBuildPlugin } from 'https://deno.land/x/[email protected]/mod.js'; | ||
import sassPluginSetup from './sass_plugin_setup.ts'; | ||
|
||
/** | ||
* The main plugin object. | ||
|
@@ -8,7 +8,7 @@ import sassPluginSetup from "./sass_plugin_setup.ts"; | |
*/ | ||
export default function sassPlugin(): ESBuildPlugin { | ||
return { | ||
name: "esbuild-plugin-sass", | ||
name: 'esbuild-plugin-sass', | ||
setup: (build) => | ||
sassPluginSetup( | ||
build.initialOptions, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import sass from 'https://deno.land/x/[email protected]/mod.ts'; | ||
import { | ||
BuildOptions, | ||
OnLoadArgs, | ||
OnLoadOptions, | ||
OnLoadResult, | ||
} from "https://deno.land/x/[email protected]/mod.js"; | ||
import sass from "https://deno.land/x/[email protected]/mod.ts"; | ||
import getTextContent from "./get_text_content.ts"; | ||
} from 'https://deno.land/x/[email protected]/mod.js'; | ||
import getTextContent from './get_text_content.ts'; | ||
|
||
/** | ||
* This function registers the onLoad function and sets some initial options. | ||
|
@@ -31,12 +31,12 @@ export default function sassPluginSetup( | |
async (args) => { | ||
const file = await Deno.readTextFile(args.path); | ||
const css = sass(file, { | ||
style: initialOptions.minify ? "compressed" : "expanded", | ||
style: initialOptions.minify ? 'compressed' : 'expanded', | ||
}).to_string(); | ||
|
||
return { | ||
contents: getTextContent(css), | ||
loader: "css", | ||
loader: 'css', | ||
}; | ||
}, | ||
); | ||
|