Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
a935dc0b86 | |||
9a43d77fe6 | |||
e9ca5147f3 | |||
b418ccd10a | |||
eeeac6cb7f | |||
c0d05bab7f | |||
0cceb23987 | |||
1b91c7a46c | |||
bd9ec3b313 | |||
ada2ae72ee | |||
ceaabe35c8 | |||
0b0c36da1b |
806
package-lock.json
generated
806
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.62",
|
"version": "1.0.68",
|
||||||
"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_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -16,36 +16,37 @@
|
|||||||
"tsbundle": "cli.js"
|
"tsbundle": "cli.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.22",
|
"@gitzone/tsbuild": "^2.1.24",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/tapbundle": "^3.2.1",
|
||||||
"tslint": "^6.1.0",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.8.7",
|
"@babel/core": "^7.9.6",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
"@babel/plugin-proposal-decorators": "^7.8.3",
|
"@babel/plugin-proposal-decorators": "^7.8.3",
|
||||||
"@babel/plugin-transform-runtime": "^7.8.3",
|
"@babel/plugin-transform-runtime": "^7.9.6",
|
||||||
"@babel/preset-env": "^7.8.7",
|
"@babel/preset-env": "^7.9.6",
|
||||||
"@babel/runtime": "^7.8.7",
|
"@babel/runtime": "^7.9.6",
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/smartcli": "^3.0.9",
|
"@pushrocks/smartcli": "^3.0.11",
|
||||||
"@pushrocks/smartfile": "^7.0.11",
|
"@pushrocks/smartfile": "^7.0.12",
|
||||||
"@pushrocks/smartlog": "^2.0.21",
|
"@pushrocks/smartlog": "^2.0.21",
|
||||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||||
"@rollup/plugin-commonjs": "^11.0.2",
|
"@rollup/plugin-commonjs": "^12.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^7.1.1",
|
"@rollup/plugin-node-resolve": "^8.0.0",
|
||||||
"@rollup/plugin-typescript": "^4.0.0",
|
"@rollup/plugin-typescript": "^4.1.2",
|
||||||
"@types/html-minifier": "^3.5.3",
|
"@types/html-minifier": "^3.5.3",
|
||||||
"@types/node": "^13.9.1",
|
"@types/node": "^14.0.5",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"rollup": "^2.1.0",
|
"rollup": "^2.10.9",
|
||||||
"rollup-plugin-babel": "^4.4.0",
|
"rollup-plugin-babel": "^4.4.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.5.0",
|
"rollup-plugin-sourcemaps": "^0.6.2",
|
||||||
"rollup-plugin-terser": "^5.3.0",
|
"rollup-plugin-terser": "^5.3.0",
|
||||||
"terser": "^4.6.7"
|
"terser": "^4.7.0",
|
||||||
|
"typescript": "^3.9.3"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
37
readme.md
37
readme.md
@ -22,10 +22,41 @@ Use TypeScript for best in class intellisense.
|
|||||||
|
|
||||||
tsbundle will bundle modern JavaScript websites in an Google Bot conformant way so things like AdSense do work.
|
tsbundle will bundle modern JavaScript websites in an Google Bot conformant way so things like AdSense do work.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
tsbundle supports two modes of usage: CLI and API usage.
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
### CLI
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Note: This is code that belongs into your terminal ;)
|
||||||
|
# Install the tool for cli usage
|
||||||
|
|
||||||
|
# Globally
|
||||||
|
npm install -g @gitzone/tsbundle
|
||||||
|
|
||||||
|
# Locally for use in your pacakge.json
|
||||||
|
npm install --save-dev @gitzone/tsbundle
|
||||||
|
|
||||||
|
# then use it
|
||||||
|
tsbundle --from="./ts/index.ts" --to="dist/bundle.js"
|
||||||
|
|
||||||
|
## note you can call tsbundle without arguments. Default values are --from="./ts_web/index.ts" --to="dist_bundle/bundle.js"
|
||||||
|
## You can use --production to enable minification using terser
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
You are using TypeScript, aren't you? Most of the stuff is apparent from the IDE intellisense.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { TsBundle } from '@gitozne/tsbundle';
|
||||||
|
|
||||||
|
const myTsBundleInstance = new TsBundle();
|
||||||
|
|
||||||
|
const run = async () => {
|
||||||
|
await myTsBundleInstance.buildTest('./from/my.ts', './to/mybundle.js')
|
||||||
|
// OR
|
||||||
|
await myTsBundleInstance.buildProduction('./from/my.ts', './to/mybundle.js')
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
|
@ -36,17 +36,14 @@ export class TsBundle {
|
|||||||
noEmitOnError: true,
|
noEmitOnError: true,
|
||||||
lib: ['esnext', 'dom', 'es2017.object'],
|
lib: ['esnext', 'dom', 'es2017.object'],
|
||||||
noImplicitAny: false,
|
noImplicitAny: false,
|
||||||
target: 'es2018'
|
target: 'es2018',
|
||||||
|
allowSyntheticDefaultImports: true
|
||||||
}),
|
}),
|
||||||
// Allow node_modules resolution, so you can use 'external' to control
|
// Allow node_modules resolution, so you can use 'external' to control
|
||||||
// which external modules to include in the bundle
|
// which external modules to include in the bundle
|
||||||
// https://github.com/rollup/rollup-plugin-node-resolve#usage
|
// https://github.com/rollup/rollup-plugin-node-resolve#usage
|
||||||
plugins.rollupResolve(),
|
plugins.rollupResolve(),
|
||||||
plugins.rollupCommonjs({
|
plugins.rollupCommonjs({}),
|
||||||
namedExports: {
|
|
||||||
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Resolve source maps to the original source
|
// Resolve source maps to the original source
|
||||||
plugins.rollupSourceMaps()
|
plugins.rollupSourceMaps()
|
||||||
|
@ -37,6 +37,22 @@ export const runCli = async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tsBundleCli.addCommand('npm').subscribe(async argvArg => {
|
||||||
|
const tsbundle = new TsBundle();
|
||||||
|
// const htmlHandler = new HtmlHandler();
|
||||||
|
switch (true) {
|
||||||
|
case argvArg.production || process.env.CI:
|
||||||
|
await tsbundle.buildProduction('./ts/index.ts', './dist_bundle/bundle.js');
|
||||||
|
// await htmlHandler.minifyHtml();
|
||||||
|
break;
|
||||||
|
case argvArg.test:
|
||||||
|
default:
|
||||||
|
await tsbundle.buildTest('./ts/index.ts', './dist_bundle/bundle.js');
|
||||||
|
// await htmlHandler.copyHtml();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
tsBundleCli.addCommand('website').subscribe(async argvArg => {
|
tsBundleCli.addCommand('website').subscribe(async argvArg => {
|
||||||
const tsbundle = new TsBundle();
|
const tsbundle = new TsBundle();
|
||||||
const htmlHandler = new HtmlHandler();
|
const htmlHandler = new HtmlHandler();
|
||||||
|
Reference in New Issue
Block a user