question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include the script with webpack

See original GitHub issue

First 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:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
white-geckocommented, Mar 14, 2020

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.

0reactions
mfranzkecommented, Feb 6, 2021

by mail. I’ve just send you a message to your gmail account.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found