Last active
August 16, 2020 17:13
-
-
Save tricsi/357bc78c10978663b4fec7ac97d62d07 to your computer and use it in GitHub Desktop.
js13k build
This file contains hidden or 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
{ | |
"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" | |
} | |
} |
This file contains hidden or 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
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() | |
] | |
}; |
This file contains hidden or 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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es2019", | |
"noImplicitAny": true, | |
"removeComments": true, | |
"sourceMap": true, | |
"lib": [ | |
"dom", | |
"es2019" | |
] | |
} | |
} |
This file contains hidden or 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
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