Questions tagged [webpack-html-loader]

Important topic to understand is the difference between html-webpack-plugin and html-loader:

How does html-webpack-plugin work with html-loader?

Html loader home page: https://github.com/webpack-contrib/html-loader

102 questions
1
vote
1 answer

HtmlWebpackPlugin load bundle.[hash].js/css into base twig file

I have two entries in my webpack.config.js. One for the JS and one for the SCSS. I can run in development and product mode. If i create a production build I get the following files: index.html, main[hash].js, main[hash].css. In the index.html i have…
The M
  • 641
  • 1
  • 7
  • 33
1
vote
1 answer

Webpack wrong relative path in css and html

I have googled a lot, but I didn't find a clear solution to my question. Both my xxx.sass and index.html will reference the same xxx.png from images folder. But the webpack resolved to the wrong relative path. I use webpack ^4.41.2, file-loader…
Charlie
  • 2,141
  • 3
  • 19
  • 35
1
vote
1 answer

webpack load some html file into index.html (like web component)

i want to separate my project file to multi files. with sass and JavaScript import, i can do that just for styles and scripts. but i want to separate HTML files too. i dont use any frameworks just webpack. according to webpack documentation, we can…
miladfm
  • 1,508
  • 12
  • 20
1
vote
0 answers

Webpack html-loader is breaking my HTML template files

The webpack html-loader breaks my html files by putting a 'module.exports' at the front of the html file. module.exports = "
my html
" I can't have this in my site. Is there any way around this? Weirdly, if I use the webpack dev-server…
Oliver Watkins
  • 12,575
  • 33
  • 119
  • 225
1
vote
0 answers

Do I need to add anything extra with php-loader in webpack 2

I am making a sales system to record and monitor sales. I am using webpack to bundle all of my code. For the backend I am using PHP and MySql. I came across php-loader package. The description says that it will load any php content and use php to…
1
vote
1 answer

Webpack Html-loader does not add template in bundle

I am having trouble creating a starter project with Angular (4.4.4) and Webpack (3.6.0). My configuration is working with AOT build and template declaration in my component, but as soon as I add a html template (and replace template with…
Mr.wiseguy
  • 4,092
  • 10
  • 35
  • 67
1
vote
1 answer

WebPack HTML and File Loader with programmatic img src

I'm using WebPack 2 and we're trying to specify an image name programmatically with Vue, and bind it in the HTML. Since the image name and path isn't bound until run-time, HTML and File Loader doesn't rewrite the url. Is there a way to tell…
user358089
1
vote
0 answers

How can i get the correct url for style background url when i use the html-loader?

for example, if i have a test.html file, the code is: test