forked from btclock/btclock_v3
LEDs and buttons working
This commit is contained in:
parent
4f2fbd8a36
commit
91fd921e2e
33 changed files with 3877 additions and 136 deletions
50
data/esbuild.mjs
Normal file
50
data/esbuild.mjs
Normal file
|
@ -0,0 +1,50 @@
|
|||
import esbuild from "esbuild";
|
||||
import { sassPlugin } from "esbuild-sass-plugin";
|
||||
import htmlPlugin from '@chialab/esbuild-plugin-html';
|
||||
import handlebarsPlugin from "esbuild-plugin-handlebars";
|
||||
import { clean } from 'esbuild-plugin-clean';
|
||||
|
||||
import postcss from "postcss";
|
||||
import autoprefixer from "autoprefixer";
|
||||
|
||||
const hbsOptions = {
|
||||
additionalHelpers: { splitText: "helpers.js" },
|
||||
additionalPartials: {},
|
||||
precompileOptions: {}
|
||||
}
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
entryPoints: ["src/css/style.scss", "src/js/script.ts", "src/index.html", "src/js/helpers.js"],
|
||||
outdir: "build",
|
||||
bundle: true,
|
||||
loader: {
|
||||
".png": "dataurl",
|
||||
".woff": "dataurl",
|
||||
".woff2": "dataurl",
|
||||
".eot": "dataurl",
|
||||
".ttf": "dataurl",
|
||||
".svg": "dataurl",
|
||||
},
|
||||
plugins: [
|
||||
clean({
|
||||
patterns: ['./build/*']
|
||||
}),
|
||||
htmlPlugin(),
|
||||
sassPlugin({
|
||||
async transform(source) {
|
||||
const { css } = await postcss([autoprefixer]).process(
|
||||
source
|
||||
, { from: undefined });
|
||||
return css;
|
||||
},
|
||||
}),
|
||||
handlebarsPlugin(hbsOptions),
|
||||
|
||||
],
|
||||
minify: true,
|
||||
metafile: false,
|
||||
sourcemap: false
|
||||
})
|
||||
.then(() => console.log("⚡ Build complete! ⚡"))
|
||||
.catch(() => process.exit(1));
|
Loading…
Add table
Add a link
Reference in a new issue