Added importing of CSS (as text), images (as data URLs)

pull/36/head
Zef Hemel 2022-07-18 12:11:03 +02:00
parent 96d945bc56
commit d5ebab0358
2 changed files with 10 additions and 0 deletions

View File

@ -120,6 +120,10 @@ async function run() {
if (
filename.endsWith(".plug.yaml") ||
filename.endsWith(".js") ||
filename.endsWith(".css") ||
filename.endsWith(".png") ||
filename.endsWith(".jpg") ||
filename.endsWith(".gif") ||
(filename.endsWith(".ts") && !filename.endsWith("_in.ts"))
) {
console.log("Change detected", eventType, filename);

View File

@ -41,6 +41,12 @@ export async function compile(
outfile: outFile,
metafile: true,
external: excludeModules,
loader: {
".css": "text",
".png": "dataurl",
".gif": "dataurl",
".jpg": "dataurl",
},
absWorkingDir: path.resolve(path.dirname(inFile)),
});