Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
pug-html-loader
Advanced tools
npm install pug-html-loader
In your sources:
var html = require('./file.pug')
// => returns file.pug content as html compiled string
In your webpack.config.js file:
module.exports = {
// your config settings ...
rules: [{
// your modules...
loaders: [{
include: /\.pug/,
loader: ['raw-loader', 'pug-html-loader'],
options: {
// options to pass to the compiler same as: https://pugjs.org/api/reference.html
data: {} // set of data to pass to the pug render.
}
}]
}]
};
pug-html-loader
encode to content to a string variable to avoid it and pass the string content to the loader chain please use the following configuration:
module.exports = {
// your config settings ...
module: [{
// your modules...
rules: [{
test: /\.pug/,
loaders: ['html-loader', 'pug-html-loader'],
options: {
// options to pass to the compiler same as: https://pugjs.org/api/reference.html
data: {} // set of data to pass to the pug render.
}
}]
}]
};
Don't forget to polyfill require
if you want to use it in node.
See webpack
documentation.
FAQs
Pug to html loader for webpack
The npm package pug-html-loader receives a total of 15,406 weekly downloads. As such, pug-html-loader popularity was classified as popular.
We found that pug-html-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.