trucks-example-boilerplate
v1.0.0
Published
Skeleton web component
Downloads
6
Readme
Boilerplate Example
This document demonstrates a simple compiler confguration with a skeleton component.
Install
npm i trucks-example-boilerplate
To build this example install the command line interface npm i -g trucks
and the example dependencies (npm i
) then run:
trucks
Compiler Options
const options = {
files: [__dirname + '/components.html'],
transforms: ['trim', 'usage'],
generators: ['page'],
out: 'build',
force: true,
html: false,
page: {
files: {
'template.html': 'index.html'
}
},
write: {
exclude: /\.?usage.html$/
}
}
module.exports = options;
Source Files
Component definition file components.html:
<!-- @component x-component -->
<dom-module id="x-component">
<template>
<style>
/* component styles (shadow scope) */
</style>
<!-- template markup -->
</template>
<style>
/* global styles (document scope) */
</style>
<script>
/* component definition and logic */
</script>
</dom-module>
<!-- @usage -->
<x-component></x-component>
Created by mkdoc on August 5, 2016