{"name":"art-template-loader","version":"1.4.1","description":"art-template loader for webpack","main":"src/index.js","scripts":{"example":"webpack --config example/webpack.config.js","test":"npm run example && mocha --ui exports 'test/**/*.js'"},"repository":{"type":"git","url":"git+https://github.com/aui/art-template-loader.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/aui/art-template-loader/issues"},"homepage":"https://github.com/aui/art-template-loader#readme","engines":{"node":">= 4.0.0"},"dependencies":{"loader-utils":"^1.1.0"},"peerDependencies":{"art-template":">=4.8.1"},"devDependencies":{"file-loader":"^0.11.1","mocha":"^3.2.0","webpack":"^2.3.3"},"gitHead":"29d1ece1513f86f61c16bea3ce6a613400eac55d","_id":"art-template-loader@1.4.1","_shasum":"6f8b14d5128a44948bb84d97a106d0c4f203754b","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"dist":{"shasum":"6f8b14d5128a44948bb84d97a106d0c4f203754b","tarball":"http://registry-npm.ywwl.com/art-template-loader/download/art-template-loader-1.4.1.tgz","integrity":"sha512-lc0pgDGg8ZUCjnmS/xejB84p/jr20EmK1hXKDbihD0wrAK/zV2TfvbZLyawGXNhVrf/k5156wEpEuKoqO09G6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj087zb+EyLyRuzLp+AzgAZg1eg75pdWKjNq0HyKSZ6wIgMS/06OKZiiub2BrYsLJez03G5ipsC9qTQHLJYZ0jdPI="}],"size":75237,"noattachment":false,"key":"/art-template-loader/-/art-template-loader-1.4.1.tgz"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/art-template-loader-1.4.1.tgz_1493893661533_0.5154424328356981"},"directories":{},"readme":"# art-template-loader\n\n[![NPM Version](https://img.shields.io/npm/v/art-template-loader.svg)](https://npmjs.org/package/art-template-loader)\n[![Node.js Version](https://img.shields.io/node/v/art-template-loader.svg)](http://nodejs.org/download/)\n\n[art-template](https://github.com/aui/art-template) loader for webpack\n\n## Install\n\n```shell\nnpm install art-template\nnpm install art-template-loader --save-dev\n```\n\n## Usage\n\nBy 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`).\n\nYou can specify which attribute combination should be processed by this loader via the query parameter `htmlResourceRules`. (Default: `htmlResourceRules=[/\\bsrc=\"([^\"]*)\"/]`)\n\nTo completely disable tag-attribute processing (for instance, if you're handling image loading on the client side) you can pass in `htmlResourceRules=false`.\n\n## Examples\n\n```js\nmodule.exports = {\n    // ...\n    module: {\n        rules: [{\n            test: /\\.jpg$/,\n            loader: \"file-loader\"\n        }, {\n            test: /\\.png$/,\n            loader: \"url-loader?mimetype=image/png\"\n        }, {\n            test: /\\.art$/,\n            loader: \"art-template-loader\",\n            options: {\n                // art-template options (if necessary)\n                // @see https://github.com/aui/art-template\n            }\n        }]\n    },\n    // ...\n}\n```\n\n```html\n<% include('./header.art') %>\n\n<% if (user) { %>\n  <h2><%= user.name %></h2>\n  <p><img src=\"./octocat.png\" alt=\"octocat\"></p>\n<% } %>\n\n<% include('./footer.art') %>\n```\n\n[More](https://github.com/aui/art-template-loader/tree/master/example)\n\n## 'Root-relative' URLs\n\nFor urls that start with a `/`, the default behavior is to not translate them.\nIf a `htmlResourceRoot` query parameter is set, however, it will be prepended to the url\nand then translated.\n\nWith the same configuration as above:\n\n``` html\n<!-- file.art -->\n<img src=\"/image.jpg\">\n```\n\n```js\nrequire(\"html-loader!./file.art\");\n\n// => '<img  src=\"/image.jpg\">'\n```\n\n```js\nrequire(\"html-loader?htmlResourceRoot=.!./file.art\");\n\n// => '<img  src=\"http://cdn.example.com/49eba9f/a992ca.jpg\">'\n```\n\n## Filter\n\nAdd filter:\n\n```js\nvar runtime = require('art-template/lib/runtime');\nruntime.dateFormat = function(){ /*[...]*/ };\nvar html = require('./index.art');\n```\n\nUse filter:\n\n```html\n{{time | dateFormat 'yyyy-MM-dd hh:mm:ss'}}\n```\n\n## Debug\n\nSupport `SourceMap`:\n\n```shell\nwebpack --debug\n```\n\n![debug](https://cloud.githubusercontent.com/assets/1791748/25306107/55b2afba-27b9-11e7-903b-4700ac47a4d3.png)\n\n## Options\n\nYou can pass [art-template options](https://github.com/aui/art-template)\nusing standard webpack [loader options](https://webpack.js.org/configuration/module/#useentry).\n","publish_time":1493893661766,"_cnpm_publish_time":1493893661766,"dist-tags":{"latest":"1.4.3"}}