# art-template-loader
**Repository Path**: mirrors_aui/art-template-loader
## Basic Information
- **Project Name**: art-template-loader
- **Description**: art-template loader for webpack
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2025-12-27
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# art-template-loader
[](https://npmjs.org/package/art-template-loader)
[](http://nodejs.org/download/)
[art-template](https://github.com/aui/art-template) loader for webpack
## Install
```shell
npm install art-template
npm install art-template-loader --save-dev
```
## Usage
By default every local `
` 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`.
## Examples
```js
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
}
}]
},
// ...
}
```
```html
<% include('./header.art') %>
<% if (user) { %>

```
```js
require("html-loader!./file.art");
// => '
'
```
```js
require("html-loader?htmlResourceRoot=.!./file.art");
// => '
'
```
## Filter
Add filter:
```js
var runtime = require('art-template/lib/runtime');
runtime.dateFormat = function(){ /*[...]*/ };
var html = require('./index.art');
```
Use filter:
```html
{{time | dateFormat 'yyyy-MM-dd hh:mm:ss'}}
```
## Debug
Support `SourceMap`:
```shell
webpack --debug
```

## Options
You can pass [art-template options](https://github.com/aui/art-template)
using standard webpack [loader options](https://webpack.js.org/configuration/module/#useentry).