creaton-loader
v1.0.3
Published
Loader for single-file Creaton components in Webpack
Downloads
33
Maintainers
Readme
creaton-loader
Loader for single-file Creaton components in Webpack
Install
npm i creaton-loader -D
webpack.config.js
module: {
rules: [
{
test: /\.html?$/,
loader: 'creaton-loader'
}
... // other rules
]
},
example Component.htm
<h2>${ this.title }</h2>
<p>${ this.message }</p>
<script>
import { httpRequest } from '../helpers'
exports = class WHome {
static mode = 'open'
static async startConnect() {
const home = await httpRequest('/db?page=home')
this.title = home.title
this.message = home.message
}
}
</script>