gwm-components

Assign individual components from a components directory

Usage no npm install needed!

<script type="module">
  import gwmComponents from 'https://cdn.skypack.dev/gwm-components';
</script>

README

gulp-web-modules plugin which will assign individual components from a components directory

Usage

If you include a components directory within any section, all files within that directly will be included as global entries to "Components" with a key matching the file name.

    {project root}
    |-- {section name}
        |-- components
            |-- foo.js
// foo.js
{abc: "def"}
// component access
var component = Components.foo;
console.log(component.def);

This is a silly example and is intended for use with creating individual react.js components

Install

Add this plugin to the gulp-web-module reference in your gulpfile

    var gulpWebModules = require('gulp-web-modules'),
        gwmComponents = require('gwm-components');

    gulpWebModules({
      plugins: [
        gwmComponents(options)
      ]
    }).injectTasks(gulp);