Questions tagged [pug-loader]

pug-loader is a webpack module used to compile Pug or Jade into HTML.

pug-loader is a webpack module used to compile Pug or Jade into HTML. This enables developers to use the simpler and less verbose Pug/Jade syntax to define their web pages, but still have the benefits of webpack dynamic packaging.

91 questions
0
votes
2 answers

Why does webpack + pug generate an Entrypoint undefined = ./index.html error?

The essence of the question is this: there is a build on webpack, everything works fine with one exception: when changing PUG files. the project is rebuilt, but the content is not updated in the browser. When building it produces an error:…
0
votes
1 answer

How to select what bundles a certain html page will use?

the project I have a project where the website view is written using Pug, then compiled to HTML. index.pug ---> index.html Because I want the project to have more than one page, I have got this, as well: about.pug ---> about.html Now, each of…
jurordrained
  • 131
  • 2
  • 9
0
votes
1 answer

Insert images with [contenthash] generated by webpack

I want to add a content hash to the images generated in my webpack config. The files are output with a hash but I'm unsure how to get these inserted into my html. Html with is generated with pug and HtmlWebpackPlugin. Relevant bits of…
Zakalwe
  • 1,444
  • 3
  • 14
  • 25
0
votes
1 answer

NestJs Microservice - Which location do I read files from?

Wondering if anyone can help? I am trying to learn how to use NestJS microservices. I have managed to succesfully get a microservice with MQTT transport setup to receive events from an API. I am trying to use pug to merge the event information with…
dcs3spp
  • 493
  • 1
  • 9
  • 23
0
votes
1 answer

External Pug Templates - Template syntax error Component template requires a root element, rather than just text

I've been battling trying to get Pug templates working with Vue class based components with the pug template as a separate file. According to the docs adding this should just work: // webpack.config.js -> module.rules { test: /\.pug$/, oneOf: [ …
Lewsmith
  • 755
  • 1
  • 6
  • 14
0
votes
0 answers

My pug files generating like a compressed file

While my files are being compressed, the teacher's files return normally. Like This : I tried to add .json file : "editor.formatOnPaste": true, "editor.formatOnType": true, but nothing changed.
0
votes
1 answer

Webpack doesn't place images in dist folder

I have a pug mixin. Mixin is using to create block with whatever image name passed as argument. mixin img({imageSrc: ""} = {}) .img(src="./img/" + imageSrc + ".jpg") As a result I want webpack either place this image in dist/img/ or processed and…
SpekalsG3
  • 155
  • 1
  • 8
0
votes
1 answer

How to fix formatting of PHP insert in Html via Gulp?

php.json { "data" : "" } home.jade script. var data = !{data}; templates.js gulp.task('templates-in-one-folder', () => { let data = dddata('ru'); return gulp.src('app/**/*.jade') …
0
votes
1 answer

Accessing nested object with pug, json, htmlwebpackplugin

I seem to be having an issue accessing a value from a mixin when trying to use bracket notation. I have the following setup: // in webpack plugins new HtmlWebpackPlugin({ hash: true, template: './assets/template/about.pug', …
gin93r
  • 1,551
  • 4
  • 21
  • 39
0
votes
2 answers

Pre-compile pug templates and save access to htmlWebpackPlugin.options

I decided to shift from ejs to pug as a template engine in my webpack projects. And what I need is pre-compiled static output (either in dev or in prod mode). Plus, I need to pass data to templates through the compilation process, and I use custom…
Alex Naidovich
  • 188
  • 4
  • 15
0
votes
1 answer

How to require images inside pug each loop from an array (webpack)

I'm trying to iterate an array with a pug loop. I use webpack and I have some problems requiring the images. If I require the image from a string (not a variable). img(src=require('images/1.png')) It works fine, but when I call it from the…
iacus
  • 1
  • 1
0
votes
0 answers

How to compile and control PUG files with Express & GULP

We are trying to set up GULP file to serve PUG files into HTML and put them into static dist folder. Here are our files: https://github.com/ShooX512/gulp-testing/ This is how we control PUG so far: app.set("views", path.join(__dirname,…
ShooX
  • 1
0
votes
1 answer

How to use object passed to index.jade in browserified script?

I am trying out browserify and ran into a problem with my project structure. I send an array to index.jade via routing from index.js. That seems to work and in the index.jade the length of the array is displayed: extends layout block content h1=…
jallmer
  • 589
  • 3
  • 17
0
votes
0 answers

How can I not preserve whitespace in my HTML template?

I'm translating an app from pug to HTML and I have some issues regarding whitespaces. I'm using vue-loader (13.x) and webpack 3.x. This code: Whitespaces, whitespaces everywhere Will translate to this…
Simon Peyou
  • 693
  • 1
  • 6
  • 13
0
votes
1 answer

Pass JSON to pug template

I can't figure out how to access JSON data in my pug templates. Here is my pug layout title #{htmlWebpackPlugin.pages[page].title} Pug page which is initializing page variable block vars - var page = "catalog" Webpack part new…
cygnus
  • 149
  • 3
  • 11