Add build script
This commit is contained in:
parent
fc5a9311f1
commit
3f8cbe1a5c
|
@ -3,10 +3,8 @@
|
|||
"repository": "unpkg/unpkg.com",
|
||||
"scripts": {
|
||||
"start": "heroku local -f Procfile.local",
|
||||
"build": "npm run build-assets && npm run build-lib",
|
||||
"build-assets": "NODE_ENV=production webpack -p --json > stats.json",
|
||||
"build-lib": "rimraf lib && babel ./modules -d lib --copy-files",
|
||||
"heroku-postbuild": "npm run build",
|
||||
"build": "node ./tools/build.js",
|
||||
"heroku-postbuild": "node ./tools/build.js",
|
||||
"lint": "eslint modules",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
const { execSync } = require('child_process')
|
||||
|
||||
console.log('Building CommonJS modules ...')
|
||||
|
||||
execSync('rimraf lib && babel ./modules -d lib --copy-files', {
|
||||
stdio: 'inherit'
|
||||
})
|
||||
|
||||
console.log('\nBuilding client bundles ...')
|
||||
|
||||
execSync('webpack -p --json > stats.json', {
|
||||
stdio: 'inherit',
|
||||
env: Object.assign({}, process.env, {
|
||||
NODE_ENV: 'production'
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue