imp: adapt build scripts to allow ES5 output

This commit is contained in:
Géry Debongnie
2019-04-04 13:20:45 +02:00
parent a86d0b5b02
commit fd26775a0f
3 changed files with 12 additions and 10 deletions
+8 -7
View File
@@ -32,13 +32,14 @@ client will ever be converted to typescript (even though I would really like it)
Some npm scripts are available:
| Command | Description |
| ------------------ | -------------------------------------------------- |
| npm install | install every dependency required for this project |
| npm run build | build a bundle of _owl_ in the _/dist/_ folder |
| npm run minify | minify the prebuilt owl.js file |
| npm run test | run all tests |
| npm run test:watch | run all tests, and keep a watcher |
| Command | Description |
| ------------------ | --------------------------------------------------------- |
| npm install | install every dependency required for this project |
| npm run build | build a bundle of _owl_ in the _/dist/_ folder |
| npm run build:es5 | build a bundle of _owl_ in the _/dist/_ folder (ES5 code) |
| npm run minify | minify the prebuilt owl.js file |
| npm run test | run all tests |
| npm run test:watch | run all tests, and keep a watcher |
## Documentation
+3 -1
View File
@@ -4,9 +4,11 @@
"description": "Odoo Web Lab",
"main": "src/index.ts",
"scripts": {
"build:js": "tsc --lib es2017,dom --target esnext --outDir dist/owl src/*",
"build:js": "tsc --target esnext --module es6 --outDir dist/owl src/*",
"build:js:es5": "tsc --target es5 --module es6 --outDir dist/owl src/*",
"build:bundle": "rollup -c",
"build": "npm run build:js && npm run build:bundle",
"build:es5": "npm run build:js:es5 && npm run build:bundle",
"minify": "uglifyjs dist/owl.js -o dist/owl.min.js --compress --mangle",
"dev": "npm-run-all --parallel \"build:* -- --watch\"",
"test": "jest",
+1 -2
View File
@@ -3,11 +3,10 @@
"module": "commonjs",
"preserveConstEnums": true,
"noImplicitThis": true,
"lib": ["es2015", "dom"],
"removeComments": false,
"inlineSourceMap": true,
"declaration": true,
"target": "es6",
"target": "es5",
"outDir": "dist",
"alwaysStrict": true,
"noUnusedLocals": true,