Compare commits

...

12 Commits

Author SHA1 Message Date
9367ad2e05 1.0.71 2020-07-07 19:11:18 +00:00
8676f97843 fix(core): update 2020-07-07 19:11:18 +00:00
f1b4e76a5b 1.0.70 2020-07-07 18:55:18 +00:00
558edb8f09 fix(core): update 2020-07-07 18:55:17 +00:00
e244ca30b9 1.0.69 2020-05-25 21:07:41 +00:00
104cdab0dc fix(core): update 2020-05-25 21:07:40 +00:00
a935dc0b86 1.0.68 2020-05-25 17:23:52 +00:00
9a43d77fe6 fix(core): update 2020-05-25 17:23:51 +00:00
e9ca5147f3 1.0.67 2020-05-25 17:01:43 +00:00
b418ccd10a fix(core): update 2020-05-25 17:01:43 +00:00
eeeac6cb7f 1.0.66 2020-05-25 16:43:58 +00:00
c0d05bab7f fix(core): update 2020-05-25 16:43:58 +00:00
4 changed files with 7687 additions and 451 deletions

8037
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@gitzone/tsbundle",
"version": "1.0.65",
"version": "1.0.71",
"private": false,
"description": "a bundler using rollup for painless bundling of web projects",
"main": "dist_ts/index.js",
@ -9,43 +9,45 @@
"license": "MIT",
"scripts": {
"test": "cd test && node ../cli.ts.js --production",
"build": "(tsbuild)",
"format": "(gitzone format)"
"build": "(tsbuild --web)"
},
"bin": {
"tsbundle": "cli.js"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.22",
"@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28",
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.33",
"@pushrocks/tapbundle": "^3.2.1",
"tslint": "^6.1.0",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@babel/core": "^7.8.7",
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"@babel/runtime": "^7.8.7",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@babel/runtime": "^7.9.6",
"@pushrocks/early": "^3.0.3",
"@pushrocks/smartcli": "^3.0.9",
"@pushrocks/smartfile": "^7.0.11",
"@pushrocks/smartlog": "^2.0.21",
"@pushrocks/smartlog-destination-local": "^8.0.2",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-typescript": "^4.0.0",
"@pushrocks/smartcli": "^3.0.12",
"@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartlog": "^2.0.35",
"@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartparcel": "^1.0.3",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-typescript": "^4.1.2",
"@types/html-minifier": "^3.5.3",
"@types/node": "^13.9.1",
"@types/node": "^14.0.19",
"html-minifier": "^4.0.0",
"rollup": "^2.1.0",
"rollup": "^2.10.9",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-sourcemaps": "^0.5.0",
"rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-terser": "^5.3.0",
"terser": "^4.6.7"
"terser": "^4.7.0",
"typescript": "^3.9.6"
},
"files": [
"ts/**/*",

View File

@ -18,17 +18,19 @@ export class TsBundle {
name: 'tsbundle',
file: toArg,
format: 'iife',
sourcemap: true
sourcemap: true,
},
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [],
watch: {
include: ['src/**']
include: ['src/**'],
},
plugins: [
// Compile TypeScript files
plugins.rollupTypescript({
include: plugins.path.parse(fromArg).dir ? plugins.path.parse(fromArg).dir + '/**/*.ts' : '**/*.ts',
include: plugins.path.parse(fromArg).dir
? plugins.path.parse(fromArg).dir + '/**/*.ts'
: '**/*.ts',
declaration: false,
emitDecoratorMetadata: true,
experimentalDecorators: true,
@ -36,20 +38,18 @@ export class TsBundle {
noEmitOnError: true,
lib: ['esnext', 'dom', 'es2017.object'],
noImplicitAny: false,
target: 'es2018'
target: 'es2018',
allowSyntheticDefaultImports: true,
}),
plugins.rollupJson(),
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
plugins.rollupResolve(),
plugins.rollupCommonjs({
namedExports: {
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
}
}),
plugins.rollupCommonjs({}),
// Resolve source maps to the original source
plugins.rollupSourceMaps()
plugins.rollupSourceMaps(),
/*plugins.rollupBabel({
runtimeHelpers: true,
extensions: ['.js', '.jsx', '.ts', '.tsx'],
@ -74,7 +74,7 @@ export class TsBundle {
]
]
})*/
]
],
};
return baseOptions;
}
@ -89,7 +89,7 @@ export class TsBundle {
plugins.rollupTerser({
compress: true,
mangle: true,
sourcemap: true
sourcemap: true,
})
);
return productionOptions;
@ -102,14 +102,26 @@ export class TsBundle {
/**
* creates a bundle for the test enviroment
*/
public async buildTest(fromArg: string, toArg: string) {
public async buildTest(
fromArg: string,
toArg: string,
bundlerArg: 'rollup' | 'parcel' = 'rollup'
) {
// 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 as plugins.rollup.OutputOptions);
await bundle.write(buildOptions.output as plugins.rollup.OutputOptions);
logger.log('ok', `Successfully bundled files!`);
switch (bundlerArg) {
case 'rollup':
logger.log('info', `bundling for TEST!`);
const buildOptions = this.getOptionsTest(fromArg, toArg);
const bundle = await plugins.rollup.rollup(buildOptions);
bundle.generate(buildOptions.output as plugins.rollup.OutputOptions);
await bundle.write(buildOptions.output as plugins.rollup.OutputOptions);
logger.log('ok', `Successfully bundled files!`);
break;
case 'parcel':
const parsedPath = plugins.path.parse(toArg);
const parcelInstance = new plugins.smartparcel.Parcel(fromArg, parsedPath.dir, parsedPath.base);
await parcelInstance.build();
}
}
/**

View File

@ -8,13 +8,15 @@ import * as smartcli from '@pushrocks/smartcli';
import * as smartfile from '@pushrocks/smartfile';
import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartparcel from '@pushrocks/smartparcel';
export { smartcli, smartfile, smartlog, smartlogDestinationLocal };
export { smartcli, smartfile, smartlog, smartlogDestinationLocal, smartparcel };
// third party scope
import * as rollup from 'rollup';
import rollupBabel from 'rollup-plugin-babel';
import rollupCommonjs from '@rollup/plugin-commonjs';
import rollupJson from '@rollup/plugin-json';
import rollupResolve from '@rollup/plugin-node-resolve';
import rollupSourceMaps from 'rollup-plugin-sourcemaps';
import { terser as rollupTerser } from 'rollup-plugin-terser';
@ -26,6 +28,7 @@ export {
rollup,
rollupBabel,
rollupCommonjs,
rollupJson,
rollupResolve,
rollupSourceMaps,
rollupTerser,