{"name":"art-template-loader","version":"0.1.2","description":"artTemplate loader for webpack","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/byends/art-template-loader.git"},"keywords":["artTemplate","loader","webpack"],"author":{"name":"Byends"},"license":"MIT","dependencies":{"art-template":"^3.0.3","loader-utils":"^0.2.15","lodash":"^4.13.1"},"gitHead":"ff7516830c848ae292733e9451b073bba8f1831c","bugs":{"url":"https://github.com/byends/art-template-loader/issues"},"homepage":"https://github.com/byends/art-template-loader#readme","_id":"art-template-loader@0.1.2","_shasum":"fc284ca9e06d56104adb67e9c72c893eef9f80eb","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"byends","email":"byends@gmail.com"},"dist":{"shasum":"fc284ca9e06d56104adb67e9c72c893eef9f80eb","tarball":"http://registry-npm.ywwl.com/art-template-loader/download/art-template-loader-0.1.2.tgz","integrity":"sha512-pmRxGTsAB7Ayt0e5YSR4NZJWeEZHsztQrOQMuO0RWxOF+lV5wc/DhchY0HUJk+RNpmzLINpK56k2f/K7afLpBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjBmnWJExlwVeoXVrmrnO8QURYmw9OsUt+/pZfstEf3gIhAJlnIuBMHYsOs79WMLJTDAHEKcVUz4rf24xn/GSfLjbX"}],"size":2099,"noattachment":false,"key":"/art-template-loader/-/art-template-loader-0.1.2.tgz"},"maintainers":[{"name":"byends","email":"byends@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/art-template-loader-0.1.2.tgz_1468653200109_0.668685752665624"},"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":1468653202490,"_cnpm_publish_time":1468653202490,"dist-tags":{"latest":"1.4.3"}}