Include the script with webpack
See original GitHub issueFirst you’ll need to integrate the JavaScript file into your code.
I installed the script with npm install loading-attribute-polyfill
, import it in my index.js
with import 'loading-attribute-polyfill';
and ran npm webpack
. (As you see I’m using webpack.)
I checked and it is in the main.js
that is loaded by my browser but unfortunately the images remain blank.
What else do I have to do to load the polyfill?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
How to add a js file with webpack? - javascript - Stack Overflow
You can use webpack-inject-plugin to inject any JS code as string into the resulting .js bundle created by webpack. This way you can...
Read more >Getting Started - webpack
First let's create a directory, initialize npm, install webpack ... createElement('div'); // Lodash, currently included via a script, ...
Read more >How to inject scripts to index html file in production? #46
I have a index html file and i need to inject in production ENV additional scripts. with gulp i can do this with...
Read more >Bundling scripts with webpack - ModDota
webpack requires you to pass a configuration file, telling it how to transform your files. As you might have noticed in the previous...
Read more >Configuring webpack and Using npm Scripts
Configuring webpack · Anything webpack requires to run goes at the top of our configuration file. For now, we only have require('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
Ah ok, this was due to the markdown/kamdown used by jekyll. It introduced a paragraph inside the include which was strange for me. Now I could disable the extra markdown interpretation (using markdown=“0” in the enclosing tag). Lacy loading makes my webpage now much more carbon (https://www.websitecarbon.com/website/natanael-arndt-xyz/) friendly, thank you.
by mail. I’ve just send you a message to your gmail account.