0.2.3 • Published 7 years ago

byu-web-component-build v0.2.3

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

web-component-build

NPM version

Build toolchain for BYU Web Components.

This toolchain bundles together components into a single js file using webpack, transpiles to ES5, minfies, and generates a file that loads the appropriate bundle and polyfills.

Currently, gulp is the only build tool supported.

Installation

npm install --save-dev byu-web-component-build

Usage

Gulp.js

Once initialized, the build will add a wc:build task to gulp, which will invoke a series of smaller tasks to build the components.

Example Gulpfile:

const initWcBuild = require('byu-web-component-build').gulp;

initWcBuild(gulp, {
    componentName: 'my-component-name',
    js: {
        input: './my-component/script.js'
    },
    css: {
        input: './css/site.scss'
    }
});

gulp.task('build', ['wc:build']);

Options

Namerequireddefaultdescription
componentNameYThe name of the component.
outputDirectoryN'dist'Directory in which to output files
jsYJavascript options
js.inputYJavascript input file
js.outputN
js.output.loaderNcomponentName + '.js'Loader file output
js.output.bundleN'components.js'Main bundle file
js.output.compatBundleN'components-compat.js'Backwards-compatibile (ES5) bundle file
webpackConfigNDefault ConfigOverrides the webpack configuration