Skip to content
Basic template for setting up a new story
CSS JavaScript HTML
Branch: master
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.
src
static-dev
static
util
.gitignore
README.md
package.json
webpack.analyse.js
webpack.common.js
webpack.dev.js
webpack.livetest.js
webpack.prod.js
webpack.release.js

README.md

Template

Basic template for setting up a new story

Setup a new project

  • Install degit once
npm install -g degit

There are several branches in this project that contain similar versions the template with for different frameworks

Minimal template

degit nzherald/template

Batteries included template

This template pulls in d3, d3-jetpack, jquery & lodash. It uses a class based template for components.

degit nzherald/template#batteries-included

ObservableHQ template

degit nzherald/template#observable

Installation

Webpack dev server should be ready to go as soon as packages are installed.

npm install
npm start

Run modes

npm run [option]

start: Runs dev server with barebone template; thick templates are available on /thick.html and /iframe.html build: Builds bundle files locally but does not deploy analyse: Builds and runs bundle-analysis tools deploy: Builds and pushes bundle files to http://s3.newsapps.nz/dev/[project name]/ release: Builds and pushes bundle files to homepage specified in package.json livetest: Builds and pushes bundle files to https://insights.nzherald.co.nz/app/livetest, which can be viewed at https://www.nzherald.co.nz/business/news/article.cfm?c_id=3&objectid=12234834

Insight component

  1. Create a new branch
git pull
git checkout -b article/[project name]
git push --set-upstream origin article/[project name]
  1. Create a new article
insights new
  1. Link index.md to build files
<div id='root'></div>
<script src='//localhost:8080/embed.js'></script>
  1. When ready, link index.md to live resources.
<link rel='stylesheet' href='https://insights.nzherald.co.nz/apps/2018/[project name]/embed.css' />
<div id='root'></div>
<script src='https://insights.nzherald.co.nz/apps/2018/[project name]/embed.js'></script>
  1. Publish
insights publish dev

Todo

Source mapping (https://webpack.js.org/guides/production/#source-mapping)

You can’t perform that action at this time.