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
+2 -1
View File
@@ -33,9 +33,10 @@ client will ever be converted to typescript (even though I would really like it)
Some npm scripts are available: Some npm scripts are available:
| Command | Description | | Command | Description |
| ------------------ | -------------------------------------------------- | | ------------------ | --------------------------------------------------------- |
| npm install | install every dependency required for this project | | npm install | install every dependency required for this project |
| npm run build | build a bundle of _owl_ in the _/dist/_ folder | | 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 minify | minify the prebuilt owl.js file |
| npm run test | run all tests | | npm run test | run all tests |
| npm run test:watch | run all tests, and keep a watcher | | npm run test:watch | run all tests, and keep a watcher |
+3 -1
View File
@@ -4,9 +4,11 @@
"description": "Odoo Web Lab", "description": "Odoo Web Lab",
"main": "src/index.ts", "main": "src/index.ts",
"scripts": { "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:bundle": "rollup -c",
"build": "npm run build:js && npm run build:bundle", "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", "minify": "uglifyjs dist/owl.js -o dist/owl.min.js --compress --mangle",
"dev": "npm-run-all --parallel \"build:* -- --watch\"", "dev": "npm-run-all --parallel \"build:* -- --watch\"",
"test": "jest", "test": "jest",
+1 -2
View File
@@ -3,11 +3,10 @@
"module": "commonjs", "module": "commonjs",
"preserveConstEnums": true, "preserveConstEnums": true,
"noImplicitThis": true, "noImplicitThis": true,
"lib": ["es2015", "dom"],
"removeComments": false, "removeComments": false,
"inlineSourceMap": true, "inlineSourceMap": true,
"declaration": true, "declaration": true,
"target": "es6", "target": "es5",
"outDir": "dist", "outDir": "dist",
"alwaysStrict": true, "alwaysStrict": true,
"noUnusedLocals": true, "noUnusedLocals": true,