From 1e03bc308892774a8e72f878b7809914241945bf Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Sat, 6 Jan 2024 00:35:15 +0100 Subject: [PATCH] try again fix demo --- demo/config.js | 11 ----------- demo/{main.js => demo.js} | 10 +--------- demo/index.html | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 demo/config.js rename demo/{main.js => demo.js} (88%) diff --git a/demo/config.js b/demo/config.js deleted file mode 100644 index 1fc420c..0000000 --- a/demo/config.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file is part of the "malle" library - * Copyright 2021 Nicolas CARPi @ Deltablot - * License MIT - * https://github.com/deltablot/malle - */ - -// this file allows us to figure out if we are in dev or demo/prod mode -// the Dockerfile will change 'dev' to 'prod' at build time -// there are no concepts of "env" in browser, so this is how we do it -export default { env: 'dev' } diff --git a/demo/main.js b/demo/demo.js similarity index 88% rename from demo/main.js rename to demo/demo.js index 05ce056..92efcb2 100644 --- a/demo/main.js +++ b/demo/demo.js @@ -4,15 +4,7 @@ * License MIT * https://github.com/deltablot/malle */ - -// figure out if we are in dev mode or demo/prod mode by loading this file -import config from './config.js'; - -// in dev mode the lib is in the parent folder, but in the docker image it is in the current dir -let libPath = './main.js'; -if (config.env === 'dev') { - libPath = '../dist/' + libPath; -} +const libPath = '../dist/main.js'; // use a dynamic named import here const { Action, InputType, Malle } = await import(libPath); diff --git a/demo/index.html b/demo/index.html index 3457551..01cc3b5 100644 --- a/demo/index.html +++ b/demo/index.html @@ -51,7 +51,7 @@

Adding a placeholder

data-ma-placeholder='you@example.com'
Your email is: niko@example.com

- +