Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
b1730c0cc6 | |||
b39c928b1e | |||
0a211e804e | |||
41a886cfcf | |||
62ad70ac6c | |||
455e33488d | |||
1af1908e1d | |||
31967ab846 | |||
93fda3944a | |||
d0ce17299a | |||
1b0fa5b465 | |||
7a6f9d9569 | |||
ebcf89520a | |||
ca6ef86c8c |
@ -1,5 +1,7 @@
|
|||||||
# gitzone ci_default
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: clone
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -38,19 +40,7 @@ snyk:
|
|||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install lts
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
@ -60,12 +50,24 @@ testSTABLE:
|
|||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
testBuild:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install lts
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install lts
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
@ -98,7 +100,9 @@ trigger:
|
|||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-dbase:npmci
|
||||||
|
services:
|
||||||
|
- docker:18-dind
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
95
package-lock.json
generated
95
package-lock.json
generated
@ -1,19 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.30",
|
"version": "1.0.38",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@airbnb/node-memwatch": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/@airbnb%2fnode-memwatch/-/node-memwatch-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-2R+MEEMSTUdKwQ6NFWkyA/UNoSjL1tMldZqJbZpgXSwNMBzlNlkUWEXKu9RqTTMkDqJRfGJ2VDs8gPlPK2APDQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"bindings": "^1.3.0",
|
|
||||||
"nan": "^2.9.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/code-frame": {
|
"@babel/code-frame": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.0.0.tgz",
|
||||||
@ -1060,15 +1050,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/tapbundle": {
|
"@pushrocks/tapbundle": {
|
||||||
"version": "3.0.11",
|
"version": "3.0.13",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.13.tgz",
|
||||||
"integrity": "sha512-s7epZfJZX+LsBVmIYvoaY4WtgPvRLnHZMVTpQAPJGMBqxJAQxhQ2wvGJjmqMAGhhznAHI6t4g+m0KTp3vFIRVg==",
|
"integrity": "sha512-23O4UMBafCuD+RnUlXNvtT9DGbL1HMD+xZE1Zcr7Ll7WvgxUgRQQfk9kq6qbLLbjaRe1J2Ijsgh1HuZbBaucLQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"leakage": "^0.4.0",
|
|
||||||
"smartchai": "^2.0.1"
|
"smartchai": "^2.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1081,24 +1070,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/chai": {
|
"@types/chai": {
|
||||||
"version": "4.1.7",
|
"version": "4.2.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.1.7.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.0.tgz",
|
||||||
"integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==",
|
"integrity": "sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/chai-as-promised": {
|
"@types/chai-as-promised": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai-as-promised/-/chai-as-promised-7.1.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fchai-as-promised/-/chai-as-promised-7.1.2.tgz",
|
||||||
"integrity": "sha512-MFiW54UOSt+f2bRw8J7LgQeIvE/9b4oGvwU7XW30S9QGAiHGnU/fmiOprsyMkdmH2rl8xSPc0/yrQw8juXU6bQ==",
|
"integrity": "sha512-PO2gcfR3Oxa+u0QvECLe1xKXOqYTzCmWf0FhLhjREoW3fPAVamjihL7v1MOVLJLsnAMdLcjkfrs01yvDMwVK4Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/chai": "*"
|
"@types/chai": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/chai-string": {
|
"@types/chai-string": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai-string/-/chai-string-1.4.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fchai-string/-/chai-string-1.4.2.tgz",
|
||||||
"integrity": "sha512-aRNMs6TKgjgPlCHwDfq/YNy5VtRR2hJ4AUWByddrT0TRVVD8eX4MiHW6/iHvmQHRlVuuPZcwnTUE7b4yFt7bEA==",
|
"integrity": "sha512-ld/1hV5qcPRGuwlPdvRfvM3Ka/iofOk2pH4VkasK4b1JJP1LjNmWWn0LsISf6RRzyhVOvs93rb9tM09e+UuF8Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/chai": "*"
|
"@types/chai": "*"
|
||||||
@ -1317,15 +1306,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
},
|
},
|
||||||
"bindings": {
|
|
||||||
"version": "1.5.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/bindings/-/bindings-1.5.0.tgz",
|
|
||||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"file-uri-to-path": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
@ -1651,12 +1631,6 @@
|
|||||||
"once": "^1.4.0"
|
"once": "^1.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"es6-error": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/es6-error/-/es6-error-4.1.1.tgz",
|
|
||||||
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"escape-string-regexp": {
|
"escape-string-regexp": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||||
@ -1700,12 +1674,6 @@
|
|||||||
"escape-string-regexp": "^1.0.5"
|
"escape-string-regexp": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"file-uri-to-path": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"find-up": {
|
"find-up": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/find-up/-/find-up-3.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/find-up/-/find-up-3.0.0.tgz",
|
||||||
@ -1960,25 +1928,6 @@
|
|||||||
"invert-kv": "^2.0.0"
|
"invert-kv": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"leakage": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/leakage/-/leakage-0.4.0.tgz",
|
|
||||||
"integrity": "sha512-x7gYK5n5dPkHDZWJ2Kh8Ag1hZNzUh+HtXn8Bv1aDdN6o6ONPCJ8sOfFq+kxcULJFp3lXaCjXb3iXOLmQRbBLwA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@airbnb/node-memwatch": "^1.0.2",
|
|
||||||
"es6-error": "^4.0.2",
|
|
||||||
"left-pad": "^1.1.3",
|
|
||||||
"minimist": "^1.2.0",
|
|
||||||
"pretty-bytes": "^4.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"left-pad": {
|
|
||||||
"version": "1.3.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/left-pad/-/left-pad-1.3.0.tgz",
|
|
||||||
"integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"locate-path": {
|
"locate-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-3.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-3.0.0.tgz",
|
||||||
@ -2126,12 +2075,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/ms/-/ms-2.1.2.tgz",
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
},
|
},
|
||||||
"nan": {
|
|
||||||
"version": "2.14.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.14.0.tgz",
|
|
||||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"nice-try": {
|
"nice-try": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/nice-try/-/nice-try-1.0.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/nice-try/-/nice-try-1.0.5.tgz",
|
||||||
@ -2323,12 +2266,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/pify/-/pify-2.3.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/pify/-/pify-2.3.0.tgz",
|
||||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||||
},
|
},
|
||||||
"pretty-bytes": {
|
|
||||||
"version": "4.0.2",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
|
|
||||||
"integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"private": {
|
"private": {
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"resolved": "https://verdaccio.lossless.one/private/-/private-0.1.8.tgz",
|
"resolved": "https://verdaccio.lossless.one/private/-/private-0.1.8.tgz",
|
||||||
@ -2798,9 +2735,9 @@
|
|||||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.18.0",
|
"version": "5.19.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.18.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.19.0.tgz",
|
||||||
"integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==",
|
"integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.0.0",
|
"@babel/code-frame": "^7.0.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.30",
|
"version": "1.0.38",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a bundler using rollup for painless bundling of web projects",
|
"description": "a bundler using rollup for painless bundling of web projects",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -19,9 +19,9 @@
|
|||||||
"@gitzone/tsbuild": "^2.1.11",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"@gitzone/tsrun": "^1.2.6",
|
"@gitzone/tsrun": "^1.2.6",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.15",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.13",
|
||||||
"@types/node": "^12.6.6",
|
"@types/node": "^12.6.6",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.19.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -51,6 +51,7 @@
|
|||||||
"ts_web/*",
|
"ts_web/*",
|
||||||
"dist/*",
|
"dist/*",
|
||||||
"dist_web/*",
|
"dist_web/*",
|
||||||
|
"dist_ts_web/*",
|
||||||
"assets/*",
|
"assets/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
|
@ -30,6 +30,6 @@ tsbundle will bundle modern JavaScript websites in an Google Bot conformant way
|
|||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
@ -10,3 +10,6 @@ early.stop();
|
|||||||
if (process.env.CLI_CALL) {
|
if (process.env.CLI_CALL) {
|
||||||
runCli();
|
runCli();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lets make this usable programmatically
|
||||||
|
export * from './tsbundle.class.tsbundle';
|
||||||
|
@ -2,49 +2,18 @@ import * as plugins from './tsbundle.plugins';
|
|||||||
import { logger } from './tsbundle.logging';
|
import { logger } from './tsbundle.logging';
|
||||||
|
|
||||||
export class TsBundle {
|
export class TsBundle {
|
||||||
public optionsTest: plugins.rollup.RollupOptions = this.getBaseOptions();
|
|
||||||
public optionsProduction: plugins.rollup.RollupOptions = (() => {
|
|
||||||
const productionOptions = this.getBaseOptions();
|
|
||||||
productionOptions.plugins.push(plugins.rollupTerser());
|
|
||||||
return productionOptions;
|
|
||||||
})();
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* creates a bundle for the test enviroment
|
|
||||||
*/
|
|
||||||
public async buildTest() {
|
|
||||||
// create a bundle
|
|
||||||
logger.log('info', `bundling for TEST!`);
|
|
||||||
const bundle = await plugins.rollup.rollup(this.optionsTest);
|
|
||||||
bundle.generate(this.optionsTest.output);
|
|
||||||
await bundle.write(this.optionsTest.output);
|
|
||||||
logger.log('ok', `Successfully bundled files!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* creates a bundle for the production environment
|
|
||||||
*/
|
|
||||||
public async buildProduction() {
|
|
||||||
// create a bundle
|
|
||||||
logger.log('info', `bundling for PRODUCTION!`);
|
|
||||||
const bundle = await plugins.rollup.rollup(this.optionsProduction);
|
|
||||||
bundle.generate(this.optionsProduction.output);
|
|
||||||
await bundle.write(this.optionsProduction.output);
|
|
||||||
logger.log('ok', `Successfully bundled files!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the basic default options for rollup
|
* the basic default options for rollup
|
||||||
*/
|
*/
|
||||||
public getBaseOptions() {
|
public getBaseOptions(fromArg: string = `ts_web/index.ts`, toArg: string = 'dist_web/bundle.js') {
|
||||||
|
logger.log('info', `from: ${fromArg}`);
|
||||||
|
logger.log('info', `to: ${toArg}`);
|
||||||
|
|
||||||
const baseOptions: plugins.rollup.RollupOptions = {
|
const baseOptions: plugins.rollup.RollupOptions = {
|
||||||
input: `ts_web/index.ts`,
|
input: fromArg,
|
||||||
output: {
|
output: {
|
||||||
name: 'tsbundle',
|
name: 'tsbundle',
|
||||||
// file: 'dist_web/bundle.js',
|
file: toArg,
|
||||||
file: 'dist_web/bundle.js',
|
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
@ -81,8 +50,8 @@ export class TsBundle {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// Resolve source maps to the original source
|
// Resolve source maps to the original source
|
||||||
plugins.rollupSourceMaps(),
|
plugins.rollupSourceMaps()
|
||||||
plugins.rollupBabel({
|
/*plugins.rollupBabel({
|
||||||
runtimeHelpers: true,
|
runtimeHelpers: true,
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||||
babelrc: false,
|
babelrc: false,
|
||||||
@ -105,9 +74,49 @@ export class TsBundle {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
})
|
})*/
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return baseOptions;
|
return baseOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getOptionsTest(fromArg: string, toArg: string): plugins.rollup.RollupOptions {
|
||||||
|
return this.getBaseOptions(fromArg, toArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getOptionsProduction(fromArg: string, toArg: string): plugins.rollup.RollupOptions {
|
||||||
|
const productionOptions = this.getBaseOptions(fromArg, toArg);
|
||||||
|
productionOptions.plugins.push(plugins.rollupTerser());
|
||||||
|
return productionOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
// Nothing here
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* creates a bundle for the test enviroment
|
||||||
|
*/
|
||||||
|
public async buildTest(fromArg: string, toArg: string) {
|
||||||
|
// create a bundle
|
||||||
|
logger.log('info', `bundling for TEST!`);
|
||||||
|
const buildOptions = this.getOptionsTest(fromArg, toArg);
|
||||||
|
const bundle = await plugins.rollup.rollup(buildOptions);
|
||||||
|
bundle.generate(buildOptions.output);
|
||||||
|
await bundle.write(buildOptions.output);
|
||||||
|
logger.log('ok', `Successfully bundled files!`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* creates a bundle for the production environment
|
||||||
|
*/
|
||||||
|
public async buildProduction(fromArg: string, toArg: string) {
|
||||||
|
// create a bundle
|
||||||
|
logger.log('info', `bundling for PRODUCTION!`);
|
||||||
|
const buildOptions = this.getOptionsProduction(fromArg, toArg);
|
||||||
|
const bundle = await plugins.rollup.rollup(buildOptions);
|
||||||
|
bundle.generate(buildOptions.output);
|
||||||
|
await bundle.write(buildOptions.output);
|
||||||
|
logger.log('ok', `Successfully bundled files!`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,13 +9,13 @@ export const runCli = async () => {
|
|||||||
const tsbundle = new TsBundle();
|
const tsbundle = new TsBundle();
|
||||||
const htmlHandler = new HtmlHandler();
|
const htmlHandler = new HtmlHandler();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case (argvArg.production) || process.env.CI:
|
case argvArg.production || process.env.CI:
|
||||||
await tsbundle.buildProduction();
|
await tsbundle.buildProduction(argvArg.from, argvArg.to);
|
||||||
await htmlHandler.minifyHtml();
|
await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
default:
|
default:
|
||||||
await tsbundle.buildTest();
|
await tsbundle.buildTest(argvArg.from, argvArg.to);
|
||||||
await htmlHandler.copyHtml();
|
await htmlHandler.copyHtml();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -11,18 +11,15 @@ export class HtmlHandler {
|
|||||||
|
|
||||||
// copies the html
|
// copies the html
|
||||||
public async copyHtml() {
|
public async copyHtml() {
|
||||||
if (!(await this.checkIfExists)) {
|
if (!(await this.checkIfExists())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await plugins.smartfile.fs.copy(
|
await plugins.smartfile.fs.copy(this.sourceFilePath, this.targetFilePath);
|
||||||
this.sourceFilePath,
|
|
||||||
this.targetFilePath
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// copies and minifies the html
|
// copies and minifies the html
|
||||||
public async minifyHtml() {
|
public async minifyHtml() {
|
||||||
if (!(await this.checkIfExists)) {
|
if (!(await this.checkIfExists())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
|
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
|
||||||
@ -35,7 +32,6 @@ export class HtmlHandler {
|
|||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
collapseInlineTagWhitespace: true,
|
collapseInlineTagWhitespace: true,
|
||||||
removeComments: true
|
removeComments: true
|
||||||
|
|
||||||
});
|
});
|
||||||
plugins.smartfile.memory.toFsSync(minifiedHtml, this.targetFilePath);
|
plugins.smartfile.memory.toFsSync(minifiedHtml, this.targetFilePath);
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
// node native
|
// node native
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export {
|
export { path };
|
||||||
path
|
|
||||||
};
|
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as smartcli from '@pushrocks/smartcli';
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
|
Reference in New Issue
Block a user