feat: transform for latest-2 browser releases (#34)

This commit is contained in:
Luca Casonato
2021-06-12 20:56:01 +02:00
committed by GitHub
parent 18feea9c45
commit ae4603c731
2 changed files with 13 additions and 9 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
import { join } from "./deps.ts";
import { join, resolve } from "./deps.ts";
import { error } from "./error.ts";
import { routes } from "./routes.ts";
@@ -44,6 +44,8 @@ export async function initSubcommand(rawArgs: Record<string, any>) {
}
async function init(directory: string) {
directory = resolve(directory);
try {
const dir = [...Deno.readDirSync(directory)];
if (dir.length > 0) {
+10 -8
View File
@@ -33,19 +33,21 @@ export class Bundler {
await ensureEsbuildInialized();
const bundle = await esbuild.build({
plugins: [freshPlugin(this.#pages), denoPlugin({ loader: "portable" })],
write: false,
bundle: true,
minify: true,
treeShaking: true,
splitting: true,
platform: "neutral",
outfile: "",
entryPoints,
format: "esm",
jsxFactory: "h",
jsxFragment: "Fragment",
metafile: true,
minify: true,
outdir: `/`,
entryPoints,
outfile: "",
platform: "neutral",
plugins: [freshPlugin(this.#pages), denoPlugin({ loader: "portable" })],
splitting: true,
target: ["chrome89", "firefox88", "safari13"],
treeShaking: true,
write: false,
});
const metafileOutputs = bundle.metafile!.outputs;