moduleloader / browser-es-module-loader Goto Github PK
View Code? Open in Web Editor NEWES Module Loader browser loading example
ES Module Loader browser loading example
i'd like to import a file with jsx and es6
On Win7, fresh install of node.js (node-v6.9.1-x64.msi),
taking your demo/Usage:
<script src="dist/babel-browser-build.js"></script>
<script src="dist/browser-es-module-loader.js"></script>
<!-- Anonymous script type module loading -->
<script type="module">
import {x} from './y.js';
</script>
I receive the error:
browser-es-module-loader.js:74 Uncaught (in promise) Error: _fs2.default.existsSync is not a function(…)
LoaderError__Check_error_message_for_loader_stack @ browser-es-module-loader.js:74
(anonymous function) @ browser-es-module-loader.js:142
thrown by:
babel-browser-build.js:
1685: return existsCache[filename] = _fs2.default.existsSync(filename);
.existsSync seems to be deprecated ...
Another concern would then be:
Please don't beat me if I'am wrong, since I just recently started into node.js ...
I would be glad, you'd give me some workaround ...
I noticed a difference between the native loading and this polyfill when importing from a route that redirects.
import _ from 'https://unpkg.com/lodash-es'
https://lodash-in-the-browser-vwtxyusbpk.now.sh
That results in 404's for some import paths.
When I link to the module directly everything resolves correctly.
import _ from 'https://unpkg.com/[email protected]/lodash.js'
https://lodash-in-the-browser-vxldnvahwg.now.sh
With the library system.js
I could import html files using:
System.import( './template.html!text' ).then( ... )
Is it/will it be possible to do the same with this library?
Example:
<script type="module">
import html as 'template.html'
</script>
I don't think it is a standard ES6 feature but it could be great substitute to HTML Imports.
I noticed this when loading the script on newer browsers that actually supports module loading, it fires document.appendChild
or similar functions twice. No issues on older browser versions.
Hi, I have this implemented on a demo page of a js repo called CountUp: inorganik.github.io/countup.js
I believe I implemented as instructed, you can see the index.html file here.
However in IE 11.379 it is is throwing
'Promise' is undefined'
on line 90 of browser-es-module-loader.js. I have also included babel-browser-build.js. Could you please take a look?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.