https://github.com/hypercubed/systemjs-plugin-html
SystemJS HTML Import plugin
https://github.com/hypercubed/systemjs-plugin-html
Last synced: about 1 year ago
JSON representation
SystemJS HTML Import plugin
- Host: GitHub
- URL: https://github.com/hypercubed/systemjs-plugin-html
- Owner: Hypercubed
- License: mit
- Created: 2015-07-08T10:34:32.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-08-16T05:34:26.000Z (almost 10 years ago)
- Last Synced: 2025-04-12T17:16:27.776Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 196 KB
- Stars: 15
- Watchers: 2
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
systemjs-plugin-html
===========
Bridging the gap between SystemJS (Universal dynamic module loader) and HTML imports. Load HTML imports via SystemJS, include SystemJS modules (ES6, AMD, CommonJS) in HTML Imports, building using vulcanize via jspm and SystemJS builder.
***Watch out: This project is an experiment. The HTML imports specification is still in flux and SystemJS is still new.***
[](https://travis-ci.org/Hypercubed/systemjs-plugin-html)
## Install
```
jspm install html=github:Hypercubed/systemjs-plugin-html
```
## Basic usage
```
import './dom-element.html!'
```
The html file is imported as an [HTML import](http://www.html5rocks.com/en/tutorials/webcomponents/imports/). The [webcomponent.js polyfills](http://webcomponents.org/) may be required in browsers that lack native support. The code above is equivalent to:
```
```
[See examples in the test folder](https://github.com/Hypercubed/systemjs-plugin-html/tree/master/test)
## Bundling
Bundling of html files is done using [Vulcanize](https://github.com/Polymer/vulcanize). When bundling an `build.html` will be created along side the `build.js` file. You can disable html imports bundling by setting `System.buildHTML = false`.
## Tests
Testing using karma:
```
karma start
```
or use [http-server](https://github.com/indexzero/http-server) and navigate to [http://localhost:8080/test/](http://localhost:8080/test/)
Tested with:
* JSPM v0.15.7
* SystemJS v0.16.11
Tested in:
* Chrome Version 43.0.2357.132 m
* IE 11.0.9600
* Firefox 39.0
* Firefox 41.0a2
## License
MIT