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 @@
data-ma-placeholder='you@example.com'
Your email is: niko@example.com