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
1
vote
0 answers

Problems with inline tags next to DIV tags when PUGs are compiled

PUG is being compiled into HTML using GULP. If you are using a gulp-pug and use the Pretty option to true, the code is composing strangely. I've solved the problem with the gulp-html-beauty, and the only thing that bothers me. the current…
1
vote
1 answer

Gulp: How can I build filename.pug to filename/index.html

Now I'm using gulp-pug gulp.task('html', function(){ return gulp.src(['src/**/*.pug', ...ignorePug]) .pipe(pug()) .pipe(gulp.dest('build')) }); How can I build my HTML, so that file names are folder names. Example: src/index.pug…
1
vote
2 answers

How to add new lines into a variable passed into pug

I am trying to pass values that need to include new lines/brake lines into pug files. So far I have tried var value1 = "value 1"; var value2 = "value 2"; var infromation = "\n" + value1 + "\n" + value2; res.render('pugfile', { information:…
Outlander
  • 13
  • 4
1
vote
1 answer

How to load assets from .pug template with html-webpack-plugin

I am going through a CSS course and have got tired of typing out similar HTML structures by hand, so I hooked up pug templates and webpack-dev-server to serve it. NOTE: my entry point is .scss file not .js I have two issues: a) only assets from css…
1
vote
1 answer

Server side rendering with Webpack and Express at runtime

Is it possible to render template files (such as Pug or Handlebars) dynamically at runtime using Webpack and Express? My issue is when loading my root page (index.pug), the html loads however no assets are loading. Example: app .set('views',…
McLovin
  • 1,455
  • 3
  • 19
  • 37
1
vote
1 answer

How to make gulp write all files simultaneously?

I have a gulp task that bulids all my pug templates (with includes): gulp.task('processMarkup', function(){ return gulp.src('src/*.pug') .pipe(pug()) .pipe(gulp.dest('./dist/')); }); I also have a watcher that runs this…
user10908202
1
vote
0 answers

Inline SVG not showing in pug and webpack

I'm using Webpack4 with pug as my template engine. My config is all set up and everything works ok. I want to add the odd inline SVG icon in my pug templates and am using this using HtmlWebpackInlineSVGPlugin which has worked for my first SVG but…
Damodog
  • 344
  • 1
  • 5
  • 15
1
vote
1 answer

Vue CLI 3 using index pug to generate pug template

I am using Vue CLI 3 with built in Webpack and I am trying to use index.pug as source index template instead of default HTML. I want to output a index.pug file as a result of webpack process for further population by Node server with dynamic…
sbay
  • 435
  • 1
  • 7
  • 20
1
vote
1 answer

Webpack 4 | pug files doesn't compile automatically

I am working on a project in which I am using Pugjs as a template engine. and webpack 4 as a bundler. when I change anything in the .pug files I have to re-run the compiler manually. any help on how I can set it so the compiler run once I edit the…
Peter Wilson
  • 4,150
  • 3
  • 35
  • 62
1
vote
1 answer

Webpack 4 + pug/sass extract/file-loaders not working with multiple imports

I'm trying something that looks pretty basic with webpack: to include .pug and .scss files with import from Javascript and have the compilation export the respective .html and .css with the extract-loader and file-loader. To make it easy to…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
1
vote
0 answers

hot reload pug with webpack

I created a web application and i'm generating my index.html with a pug file. The pug template needs to get data from a json file, and so far I managed to inject the data with both pug-loader and pug-html-loader. The problem comes when I run the…
1
vote
2 answers

How to load Pug templates in webpack without compiling to HTML?

Both pug-loader and pug-html-loader seem to be focused on pre-compiling Pug templates to HTML. I don't want to do that as I need some of the dynamic rendering capabilities that you only get when rendering templates, like being able to pass in a…
user7898281
1
vote
0 answers

Webpack: Unable to require pug in javascript file

We are using Jade Templates in our project and Webpack 1 to bundle. Recently we were asked to update Webpack and Jade (which is now Pug). The .pug files are successfully getting converted to HTML but whenever we try to require a .pug file in…
Hardik
  • 283
  • 1
  • 8
  • 19
1
vote
0 answers

Webpack Config - Pass [hash] to loader data

Im using the pug-html-loader to load a large number of pug templates and convert them to html in the build directory. this is working fine, but I want to be able to insert the webpack hash in the pug templates. I cant work out how to set up my…
Matthew
  • 952
  • 7
  • 20
1
vote
0 answers

Not a webpack file pug compiler?

When running webpack-dev-server produces an error Module build failed: TypeError: text.forEach is not a function enter image description here 'use strict'; var webpack = require('webpack'); var ExtractTextPlugin =…
Viktor
  • 17
  • 1
  • 5