-
Notifications
You must be signed in to change notification settings - Fork 0
Previewing and Deploying
You'll want to be constantly reloading the project as you go, so you'll want a mini-server.
If you're not making any external calls that require https, a vanilla localhost like http-server should work fine:
npm install http-server -g
http-server -p 8081 -a 127.0.0.1
If you needs to simulate an HTTPS environment, use https-localhost
sudo serve ./apps # or whatever directory above the interactive you prefer
If calling any assets from the time.com assets pipeline, you'll need to route your localhost to https://local.time.com, but updating your /etc/hosts to map localhost to local.time.com:
`127.0.0.1 local.time.com`
The package.json has several shortcuts for building and deploying. You'll need the AWS CLI for your local environment for the later commands, as well as the private keys for our S3 buckets.
-
npm run buildwill compiledebug.jswith source mapping toscript.js, viewable inindex.html -
npm run watchwill compiledebug.jswith source mapping toscript.jswhenever a file is modified -
npm run minifywill compile the minifiedscript-min.jsforembed.html -
npm run dryrunwill mock deploy your project. Always run this first. -
npm run stagewill push to the AWS staging directory. -
npm run uploadwill push to AWS. -
npm run deploywill minify and upload
Once the short-code is in place, you just need to deploy the minified script file. This uploads both to our static S3 bucket and, sometimes after a few minutes, to \\assets.time.com/interactives/my_awesome_app_2021/script-min.js. If you made a mistake and need a fix to propagate quickly, ask Chris Wilson, who still has the secret key from Fred Cooper.
Next: Safety First!