├── .eslintrc ├── .gitignore ├── README.md ├── index.js ├── npm-shrinkwrap.json └── package.json /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "node": true 6 | }, 7 | "ecmaFeatures": { 8 | "modules": true 9 | }, 10 | "rules": { 11 | "quotes": [0], 12 | "no-new": [0], 13 | "no-mixed-requires": [0, false], 14 | "no-loop-func": [0], 15 | "no-alert": [0], 16 | "eol-last": [0], 17 | "no-unused-vars": [2, {"vars": "all", "args": "none"}], 18 | "no-unused-expressions": [0] 19 | }, 20 | "globals": { 21 | "ga": false 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # template-string-loader 2 | Webpack [ES6 Template String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings) Loader 3 | 4 | ## Installation 5 | 6 | `npm install template-string-loader` 7 | 8 | ## Usage 9 | You will need to use this with the babel loader or some other ES6 loader that supports template strings. 10 | 11 | ``` javascript 12 | var template = require("babel!template-string!./file.html")({data: '123'}); 13 | ``` 14 | 15 | Example template: 16 | 17 | ``` html 18 | 19 |