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
0
votes
1 answer

webpack: alias does not work in HTML tags

Is there any reasons why the alias below does not work in HTML tags or work in JavaScript? In my webpack config file: resolve: { alias: { '~': path.resolve(__dirname, './src/') } }, ... ... ... { test:…
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
0 answers

Webpack - HTML loader doens't scan all files

I have implemented html-loader on my Webpack configuration file: module: { rules: [ { test: /\.html$/i, exclude: /(node_modules)/, use: ['html-loader'], }, ] } When I try to run webpack…
Ron Rofe
  • 738
  • 1
  • 9
  • 25
0
votes
1 answer

Webpack 4 generates wrong src path for img tags in different levels of folder structure

I have a Webpack 4 project to make a multi language admin-dashboard with this folder and file structure: admin-dashboard | |--build | |--assets | | |--img | | |--font | |--fa | | |--index.html ----> rtl html output (gets wrong img src like…
Aspian
  • 1,865
  • 3
  • 24
  • 31
0
votes
1 answer

How to manipulate a received svg (access '' and '' elements) via vue

I'm getting several SVG's that are all structured like this: ...
Matthias
  • 3,729
  • 22
  • 37
0
votes
0 answers

HTMLwebpackPlugin - Is it possible to require partials while in partial?

Earlier I've been using gulp-nunjucks for templating - content extends layout and includes partials. So I've tried to sorta replicate this with html-webpack-plugin webpack.config.js const pages = ['home', 'page1']; const pagesToHTMLPlugin =…
0
votes
1 answer

How to reference an image asset inside the index.html template

Inside my template that exports as index.html, I have this line: My goal is to have it be exported with the hashed name:
Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125
0
votes
1 answer

Run external function when knockout component is created

I am trying to create new component in knockout: ko.components.register("categories", { viewModel: { instance: MY_VIEW_MODEL }, template: require('html-loader?interpolate!./components/categories.html') }); and my HTML block…
mullen18
  • 121
  • 2
  • 7
0
votes
2 answers

Static webpage webpack hotloader does not work

Here is a repo I just created to get this issue solved: https://github.com/DevCubeHD/WebpackStaticPage First of all: File structure. There are two important folders you should know to understand my example in case it isn't even convention. The /src…
Felix Gaebler
  • 702
  • 4
  • 23
0
votes
2 answers

Image's src attribute equals "[object Object]" when processed by Webpack

I'm using Webpack to process HTML and assets, here's the minimal webpack.config.js: const CleanWebpackPlugin = require('clean-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const OUTPUT_DIR = __dirname +…
Slava Fomin II
  • 26,865
  • 29
  • 124
  • 202
0
votes
1 answer

Change templateUrl property before webpack build

I have an angular2 application which is being bundled by web pack. I am using html-loader to load html files. I wanted to ask that is there a way i can change my template url before the webpack build process starts? Like when webpack build is about…
Asad Ullah
  • 2,257
  • 2
  • 24
  • 23
0
votes
1 answer

Glob many html files with webpack html-loader?

I'm trying to hash and optimize my images within HTML files that are generated by the static site generator Hugo. I can get html-loader to process files one at a time, using a test config of: entry: { main: './entry.js' }, module: { …
Coleman
  • 422
  • 2
  • 11
0
votes
1 answer

Embedding HTML files with webpack

I'm looking into migrating a large, homegrown build script for one of our projects to webpack. One feature it has is it traverses a /views directory and copies the contents of the html files into a main index.html file. This allows us to easily use…
1 2 3 4 5 6
7