vue2-html-loader
v1.0.5
Published
A webpack loader handle .html file for Vue2
Downloads
106
Readme
npm i -D vue2-html-loader
{
test: /\.(html)$/,
use: {
loader: 'vue2-html-loader',
options: {
removeComments: true,
removeWhiteSpace: true,
removeNewline: true,
}
}
}
import template from 'path/to/your/template.html';
new Vue({
template,
...otherOptions
});
Use Typescript
import template from 'path/to/your/template.html';
@Component({
template,
})
export default class VueComponents extends Vue {
...others
}
Options Quick Reference
Most of the options are disabled by default.
| Option | Description | Default |
| ------------------ | --------------------------------- | ------- |
| removeComments
| remove html comments | true
|
| removeWhiteSpace
| remove html whiteSpace | true
|
| removeNewline
| remove html newLine (actual \r\n) | true
|