The page-browserify generator hasn't been built to install any Javascript libraries by default. But a number of components found on the default interactive page require jQuery.
This wouldn't be a problem in the short term, because the Javascript we bring in from @dallasmorningnews/interactives_starterkit is ES5 code that loads in a CDN-sourced jQuery (which is imported in a simple script tag in ./src/templates/base.html). But in the long term, we want to move the starter kit files into a Node package that can take advantage of the NPM-installed jQuery, and do away with the separate script embed.
Having an explicitly importable jQuery install will also help users (like the interactives team) comprehend how to get started with ES6 imports — our sample ./src/js/scripts.js will provide users a demonstration of how to import jQuery and implement a $(document).ready() function.
The
page-browserify
generator hasn't been built to install any Javascript libraries by default. But a number of components found on the default interactive page require jQuery.This wouldn't be a problem in the short term, because the Javascript we bring in from @dallasmorningnews/interactives_starterkit is ES5 code that loads in a CDN-sourced jQuery (which is imported in a simple script tag in
./src/templates/base.html
). But in the long term, we want to move the starter kit files into a Node package that can take advantage of the NPM-installed jQuery, and do away with the separate script embed.Having an explicitly importable jQuery install will also help users (like the interactives team) comprehend how to get started with ES6 imports — our sample
./src/js/scripts.js
will provide users a demonstration of how to import jQuery and implement a$(document).ready()
function.