An example Twig Component library using Webpack.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
src/components/tce-hero
test
.eslintignore
.eslintrc.json
.gitignore
.travis.yml
README.md
index.html
package-lock.json
package.json
wct.conf.json
webpack.config.js

README.md

Build Status

twig-components-example

An example Twig Component library using Webpack.

This project was originally generated using generator-twig-components-webpack.

Getting started

To run a local webserver that shows how these components can be used, run npm install && npm start.

Including components on your site

To use these components on your site, include dist/components.bundled.js on the page and any of the included component tags. For example:

<html>
  <head>
    <script src="./twig-components-example/components.bundled.js"></script>
  </head>
  <body>
    <tce-hero src="hero.jpg" text="Great intro" subtext="Better follow up" callout-text="Click me" callout-href="/submit" align="middle"></tce-hero>
  </body>
</html>

Should render the tce-hero tag.

If you prefer to manage polyfills and the Twig.js library yourself, you can include components.js.

Running the build

To execute the entire production Webpack build, run npm run build.

Running tests

Tests are written with the web-component-tester package.

To run tests, ensure Java is available in your PATH, then run npm test.