-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESM/ES6 module format #124
Comments
Not sure what this means but happy to accept a PR
…On Wed, 14 Jul 2021, 16:48 cdalexndr, ***@***.***> wrote:
Please provide esm format distribution for importing in browser directly
without any module loader.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#124>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZFBZOIK2TPYX35GBNIJTTXWWS7ANCNFSM5ALXNBAA>
.
|
Is this still relevant/needed? Maybe can offer some help. |
It lets you do this: <script type="module"> import { FastDom } from '/path/to/fastdom';
… EDIT: in JS you use the // file1.js
export const a = "A!";
export const b = "B :D";
export const c = "C :)";
export const d = "D :3";
// file2.js
// this is just an example of ways import can be used
import {a, b}, * from 'file1.js';
… |
I believe that defeates the purpose of the library. |
Every ESM module works like a singleton, so no problem. |
@VitorLuizC Do not make assumptions about whether it is a problem or not. Your personal perspective and needs do not apply to everone. Web project vary and it is an issue if you don't have modules all the way through. Right now it is one global instance accessible from every scope which some may require if they can't/won't rewrite their codebase. <head>
<script src="./js/fastdom.min.js"></script>
<script type="module">
/* use within a (new) module */
console.log( window.fastdom );
</script>
</head>
<body>
<script>
/* use within "old" code */
console.log( window.fastdom );
</script>
</body> Anyway you can (already) use this as module. import "./fastdom.min.js"
console.log(fastdom); |
Please provide esm format distribution for importing in browser directly without any module loader.
The text was updated successfully, but these errors were encountered: