Skip to content

Commit

Permalink
try again fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Jan 5, 2024
1 parent 8affe1a commit 1e03bc3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
11 changes: 0 additions & 11 deletions demo/config.js

This file was deleted.

10 changes: 1 addition & 9 deletions demo/main.js → demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>Adding a placeholder</h2>
<p><code>data-ma-placeholder='[email protected]'</code><br>Your email is: <span data-malleable='true' data-ma-placeholder='[email protected]' data-ma-type='email'>[email protected]</span></p>
</div>

<script src='main.js' type='module'></script>
<script src='demo.js' type='module'></script>

</body>
</html>

0 comments on commit 1e03bc3

Please sign in to comment.