Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Last active November 8, 2019 22:49
Show Gist options
  • Save apaleslimghost/9cc0a8078b5cdc0de34175697e07befd to your computer and use it in GitHub Desktop.
Save apaleslimghost/9cc0a8078b5cdc0de34175697e07befd to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const loadPackageJson = require('@financial-times/package-json')
const { execSync } = require('child_process')
const packageJson = loadPackageJson({ filepath: './package.json' })
packageJson.requireDependency({ pkg: 'parcel-bundler', version: '^1.12.0', field: 'devDependencies' })
packageJson.setField('scripts', {
start: 'parcel index.html',
build: 'parcel build index.html'
})
packageJson.writeChanges()
execSync('touch index.html', { stdio: 'inherit', env: process.env })
execSync('npm install', { stdio: 'inherit', env: process.env })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment