Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
art-template-loader
Advanced tools
art-template loader for webpack
npm install art-template
npm install art-template-loader --save-dev
By default every local <img src="image.png">
is required (require('./image.png')
). You may need to specify loaders for images in your configuration (recommended file-loader
or url-loader
).
You can specify which attribute combination should be processed by this loader via the query parameter htmlResourceRules
. (Default: htmlResourceRules=[/\bsrc="([^"]*)"/]
)
To completely disable tag-attribute processing (for instance, if you're handling image loading on the client side) you can pass in htmlResourceRules=false
.
module.exports = {
// ...
module: {
rules: [{
test: /\.jpg$/,
loader: "file-loader"
}, {
test: /\.png$/,
loader: "url-loader?mimetype=image/png"
}, {
test: /\.art$/,
loader: "art-template-loader",
options: {
// art-template options (if necessary)
// @see https://github.com/aui/art-template
}
}]
},
// ...
}
<% include('./header.art') %>
<% if (user) { %>
<h2><%= user.name %></h2>
<p><img src="./octocat.png" alt="octocat"></p>
<% } %>
<% include('./footer.art') %>
For urls that start with a /
, the default behavior is to not translate them.
If a htmlResourceRoot
query parameter is set, however, it will be prepended to the url
and then translated.
With the same configuration as above:
<!-- file.art -->
<img src="/image.jpg">
require("html-loader!./file.art");
// => '<img src="/image.jpg">'
require("html-loader?htmlResourceRoot=.!./file.art");
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg">'
Add filter:
var runtime = require('art-template/lib/runtime');
runtime.dateFormat = function(){ /*[...]*/ };
var html = require('./index.art');
Use filter:
{{time | dateFormat 'yyyy-MM-dd hh:mm:ss'}}
Support SourceMap
:
webpack --debug
You can pass art-template options using standard webpack loader options.
FAQs
art-template loader for webpack
The npm package art-template-loader receives a total of 196 weekly downloads. As such, art-template-loader popularity was classified as not popular.
We found that art-template-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.