Skip to content

Instantly share code, notes, and snippets.

@tricsi
Last active August 16, 2020 17:13
Show Gist options
  • Save tricsi/357bc78c10978663b4fec7ac97d62d07 to your computer and use it in GitHub Desktop.
Save tricsi/357bc78c10978663b4fec7ac97d62d07 to your computer and use it in GitHub Desktop.
js13k build
{
"name": "js13kbuild",
"scripts": {
"start": "rollup -c -w",
"build": "rollup -c && cd build && html-minifier --collapse-whitespace --remove-tag-whitespace --minify-css true dev.html > index.html && advzip -a4 build.zip index.html",
},
"devDependencies": {
"@rollup/plugin-image": "^2.0.5",
"@rollup/plugin-typescript": "^5.0.2",
"@types/node": "^14.0.27",
"advpng-bin": "^5.0.1",
"advzip-bin": "^2.0.0",
"glob": "^7.1.6",
"html-minifier": "^4.0.0",
"rollup": "^2.23.1",
"rollup-plugin-glsl": "^1.3.0",
"rollup-plugin-html-bundle": "0.0.3",
"rollup-plugin-serve": "^1.0.3",
"rollup-plugin-terser": "^7.0.0",
"tslib": "^2.0.1",
"typescript": "^3.9.7"
}
}
import typescript from "@rollup/plugin-typescript";
import image from "@rollup/plugin-image";
import glsl from "rollup-plugin-glsl";
import bundle from "rollup-plugin-html-bundle";
import { terser } from "rollup-plugin-terser";
import serve from "rollup-plugin-serve"
const isDev = process.env.npm_lifecycle_event !== "build";
export default {
input: "src/main.ts",
output: {
dir: "build",
format: "iife",
sourcemap: isDev
},
plugins: [
typescript(),
image(),
glsl({
include: /\.(frag|vert)$/
}),
terser(),
bundle({
template: "src/index.html",
target: "build/dev.html",
inline: !isDev
}),
isDev && serve()
]
};
{
"compilerOptions": {
"target": "es2019",
"noImplicitAny": true,
"removeComments": true,
"sourceMap": true,
"lib": [
"dom",
"es2019"
]
}
}
declare module '*.png' {
const content: string;
export default content;
}
declare module '*.frag' {
const content: string;
export default content;
}
declare module '*.vert' {
const content: string;
export default content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment