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.

How to have inline assets working in production bundling?

See original GitHub issue

I’ve tried several times to configure Webpack to be able to bundle inline assets, such as <img src="path/images/xyz.jpg" />, however, the paths do not get updated within the dist bundle and I don’t believe the assets are there either.

Any ideas?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
vivaPQcommented, Mar 29, 2017

Cool

  1. I don’t really think it makes any difference as long as the files are there for you (runtime and deploy time);
  2. I didn’t find a solution for not duplicating it… just by removing the loaders: ['file-loader?hash=sha512&digest=hex&name=[hash].[ext]', 'image-webpack-loader'] but then it might break the .styl url
0reactions
FarhadGcommented, Jul 6, 2017

I noticed we could also leverage the html-loader to be able to require assets within html templates.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bundle inlining - Parcel
Parcel includes several ways to inline the compiled contents of one bundle inside another bundle.
Read more >
Production | webpack
In this guide, we'll dive into some of the best practices and utilities for building a production site or application.
Read more >
How to Bundle a Simple Static Site Using Webpack - SitePoint
Add the following to app.js : require('./main.js');. And change the webpack config thus: entry: './src/js/app.js',. Run npm run build again to ...
Read more >
Webpack 5 - how to bundle assets from an npm module
To get around this issue I have converted all images in myNpmModule to data URL's using the webpack asset module ("asset/inline").
Read more >
JavaScript Bundling | Commerce Frontend Development
JavaScript bundling does not work unless the application is in production mode. Once in production mode, JavaScript bundling can only be ...
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