Skip to content

Instantly share code, notes, and snippets.

@ganobrega
Last active October 20, 2023 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganobrega/28047cf3b71e9d27135e5ac671d95f7a to your computer and use it in GitHub Desktop.
Save ganobrega/28047cf3b71e9d27135e5ac671d95f7a to your computer and use it in GitHub Desktop.
Checkout with Deno - Alpha

VTEX Checkout with Deno

No polyfill. No browserlist.

This is a alpha version that I'm not using any more...

Now I'm using ESBuild and PostCSS

  1. First create a new app using checkout-ui-settings scaffold
  $ vtex init

image

  1. Inside the directory app-name > checkout-ui-custom create files:
  • deno.json
  • dev.ts
  1. Start the build running:
$ deno task start
  1. Now link the app

  2. Done!

{
"tasks": {
"start": "deno run -A --watch=checkout6-custom.scss,checkout6-custom.ts,layout/,helpers/,components/,styles/ dev.ts"
},
"imports": {},
"nodeModulesDir": true
}
/// <reference lib="deno.ns" />
import { bundle } from "https://deno.land/x/buckets@v0.7.0/mod.ts";
import sass from "https://deno.land/x/denosass@1.0.6/mod.ts";
/*########*
*# JS #*
*########*/
const js = await bundle("./checkout6-custom.ts", "deno.json");
Deno.writeTextFileSync("./checkout6-custom.js", js);
/*#########*
*# CSS #*
*#########*/
const css = sass(Deno.readTextFileSync("./checkout6-custom.scss"), {
load_paths: [
"./styles/abstract",
"./styles/components",
"./styles/layout",
"./styles/tools",
"./styles/vendors",
],
});
Deno.writeTextFileSync(
"./checkout6-custom.css",
css.to_string("expanded") as string,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment