32 lines
702 B
TypeScript
32 lines
702 B
TypeScript
import SSSG, { Plugin } from "sssg";
|
|
import Dev from "sssg/src/plugins/dev";
|
|
import TSCompiler from "sssg/src/plugins/ts-compiler";
|
|
import PostCSS from "sssg/src/plugins/postcss"
|
|
import tailwindcss from "@tailwindcss/postcss"
|
|
import * as path from "path";
|
|
|
|
let isProd = process.argv.at(2) == "prod"
|
|
|
|
const sssg = new SSSG({
|
|
outputFolder: path.join(import.meta.dir, "dist"),
|
|
inputFolder: path.join(import.meta.dir, "frontend"),
|
|
});
|
|
|
|
const plugins: Plugin[] = [
|
|
new TSCompiler(isProd),
|
|
new PostCSS([
|
|
tailwindcss({
|
|
base: path.join(import.meta.dir, "frontend"),
|
|
})
|
|
]),
|
|
]
|
|
|
|
if(!isProd) {
|
|
plugins.push(new Dev(sssg, {}, 8080))
|
|
}
|
|
|
|
await sssg.run({
|
|
plugins,
|
|
});
|
|
|
|
await sssg.build();
|