feat(components): add basic components
Some checks failed
Publish package / build_and_publish (push) Failing after 21s
Some checks failed
Publish package / build_and_publish (push) Failing after 21s
This commit is contained in:
parent
ee567abf6b
commit
d4a11146aa
11 changed files with 174 additions and 4 deletions
32
packages/components/build.ts
Normal file
32
packages/components/build.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { type BunPlugin } from "bun";
|
||||
import dts from "bun-plugin-dts";
|
||||
import styleLoader from "bun-style-loader";
|
||||
import * as sass from "sass";
|
||||
|
||||
const style: BunPlugin = {
|
||||
name: "Sass Loader",
|
||||
setup(build) {
|
||||
console.log("Running SASS Plugin...");
|
||||
build.onLoad({ filter: /\.scss$/ }, async ({ path }) => {
|
||||
const contents = sass.compile(path);
|
||||
const css = contents.css;
|
||||
|
||||
return {
|
||||
loader: "file",
|
||||
contents: css,
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const result = await Bun.build({
|
||||
outdir: "dist",
|
||||
publicPath: "public",
|
||||
format: "esm",
|
||||
plugins: [style],
|
||||
entrypoints: ["./src/components.scss"],
|
||||
});
|
||||
|
||||
if (!result.success) {
|
||||
throw new AggregateError(result.logs, "Build failed");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue