HTML Webpack Plugin
This is a webpack loader for html files, that are
looks like 'components': contain html
, inline js
and scss
.
Maintainer: vtlk @vtlk7
Installation
Install the plugin with npm:
$ npm install html-component-loader --save-dev
Important
It works with html-loader.
Basic Usage
var webpackConfig = ... module: test: /\.html$/ use: loader: 'html-loader' options: minimize: false interpolate: 'require' attrs: false loader: 'html-component-loader' options: src: __dirname ...;
This will generate from this:
${require('./src/includes/head.html')} 12 12 ${require('./src/includes/blocks/some.html')}
this:
<!--#BEGIN#--> <!-- /includes/head.html --> vue-simple <!--#END#--> 12 12 <!--#BEGIN#--> <!-- /includes/blocks/some.html --> hello world <!--#END#-->
As you are see, this loader just preprocess your included html components and inject transformed code into main html file.
Example of /includes/blocks/some.html
hello world
Configuration
Allowed values are as follows:
src
: root of your project directory (__dirname
)
License
This project is licensed under MIT.