Basic template for setting up a new story
Setup a new project
npm install -g degit
There are several branches in this project that contain similar versions the template with for different frameworks
Batteries included template
This template pulls in d3, d3-jetpack, jquery & lodash. It uses a class based template for components.
Webpack dev server should be ready to go as soon as packages are installed.
npm install npm start
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
- Create a new branch
git pull git checkout -b article/[project name] git push --set-upstream origin article/[project name]
- Create a new article
- Link index.md to build files
<div id='root'></div> <script src='//localhost:8080/embed.js'></script>
- 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>
insights publish dev
Source mapping (https://webpack.js.org/guides/production/#source-mapping)