Webpack angular templateCache loader
npm install angular-templatecache-loadershell
npm i angular-templatecache-loader
`
Examples
main.js
`javascript
var myTemplate = require('./src/myTemplate.html'); // You will have your template in myTemplate variable
`
index.html
`javascript
`
Options
1. module - name of angular module (default is ng)
`javascript
{
test: /\.html$/,
loader: "angular-templatecache-loader?module=app"
}
`
2. prefix - add prefix to all file names
`javascript
{
test: /\.html$/,
loader: "angular-templatecache-loader?prefix=/public/src"
}
`
3. You can also use context in webpack to pass correct template url. See Context example
`javascript
var app = path.join(__dirname, 'app');
module.exports = {
context: app
}
``