Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 900 Bytes

Readme.md

File metadata and controls

58 lines (41 loc) · 900 Bytes

Webpack Static Boilerplate

This boilerplate makes developing static html sites easy by allowing html imports.

Transform this:

<!-- views/index.html -->
<div>
  ${require('../partials/header.html')}

  <h1>Hello, World!</h1>
</div>

<!-- partials/header.html -->
<div>
  My site
</div>

into this:

<!-- views/index.html -->
<div>
  <div>
    My site
  </div>

  <h1>Hello, World!</h1>
</div>

Inspired by this blog post from extri.co.

Install

$ git clone https://github.com/jverneaut/webpack-static-boilerplate
$ npm install

Run

$ # Starts a development server on port 4000 with auto relaod
$ npm run watch

To build for production use

$ npm run build

Usage

Use ${require(./myFile.html)} to include external html files.