Add build for <script type="module">
See original GitHub issueI’m currently trying to use import 'object-hash/dist/object_hash.js';
to pull objectHash into my project. Unfortunately, it throws the following error:
I created a jsfiddle that shows the problem.
At a minimum, it would be ideal to resolve the current build issue. In the future, it would be really helpful if you could support the .mjs
extension in your build, such as:
https://github.com/pladaria/reconnecting-websocket/blob/master/rollup.config.js#L22
Thanks for your help.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:10
Top Results From Across the Web
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >Modules, introduction
Build tools do the following: Take a “main” module, the one intended to be put in <script type="module"> in HTML.
Read more >How to use code from script with type=module [duplicate]
If I get rid of type=module (and import/export by putting the showMessage function right in showImport.js ) everything works, but the whole ...
Read more >How to add a js script as type="module" - Drupal Answers
Yes, it is possible, with the attributes property. my-library: version: 1.x js: js/App.js: { attributes: { type: module } }. See Adding ......
Read more >TypeScript and <script type="module"></script> #13422
A first implementation of <script type="module"><script> just landed in ... If I'm right, is it possible to add an option to force path ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Experiencing the same thing after upgrading my site to Angular 8 (which uses
script type="module"
). It’s a couple months later- is there a fork anyone knows about that supports this?The problem is currently related to browserify and the node crypto lib. On 1108,
r = this
andthis = window
within this context. Unfortunately when using<script type="module">
, usingthis
within its context is undefined.Attached is the non-minified code: