Jerko Steiner 9d282b278d Build ESM client-side modules to enable tree shaking
TypeScript compiler needs to be configured to output ES6 module by
setting --module es6 or the equivalent tsconfig.json compilerOptions
parameter.

Since tsc --build does not accept compiler options flags, we need to
duplicate some of the configuration:

- specify separate output folder for ES6 module files (new
  tsconfig.esm.json file)
- add "module" field for ES6 module (esm) output files to package.json

Hence, a script `scripts/sync-esm-config.js` was added to automate this
process.
2019-04-11 11:40:07 +08:00

39 lines
1.4 KiB
JSON

{
"name": "@rondo/server",
"private": true,
"scripts": {
"test": "jest",
"lint": "tslint --project .",
"clean": "find src/ -type f -name '*.js' | xargs rm",
"watch": "npm-run-all -p '*:watch'",
"js:build": "browserify src/client/index.tsx -p [ tsify --project .] -g [ loose-envify purge --NODE_ENV production ] -v -o build/client.js",
"js:watch": "watchify src/client/index.tsx -p [tsify --project .] -v -d -o build/client.js",
"js:minify": "terser --ecma 5 --compress -o build/client.min.js --mangle -- build/client.js",
"start": "ts-node src/server/index.ts",
"start:watch": "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.test.ts' --exec ts-node src/server/index.ts",
"typeorm": "ts-node ./node_modules/.bin/typeorm"
},
"dependencies": {
"bcrypt": "^3.0.3",
"body-parser": "^1.18.3",
"cls-hooked": "^4.2.2",
"csurf": "^1.9.0",
"email-validator": "^2.0.4",
"express": "^4.16.4",
"express-session": "^1.15.6",
"http-errors": "^1.7.1",
"js-yaml": "^3.12.1",
"passport": "^0.4.0",
"passport-google": "^0.3.0",
"passport-local": "^1.0.0",
"reflect-metadata": "^0.1.12",
"shortid": "^2.2.14",
"sqlite3": "^4.0.4",
"typeorm": "^0.2.11",
"uuid": "^3.3.2",
"winston": "^3.1.0"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "esm/index.js"
}