Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
576ec20e3c | |||
6d48086266 | |||
e3a6e065ee | |||
63d35e2ce8 | |||
d5753019cf | |||
a3ab55cbc6 | |||
ae16fd8170 | |||
cf9ca73cd8 | |||
687b83bafd | |||
3c9b178c09 | |||
5f92b58353 | |||
ed75a7c695 | |||
59f32fed12 | |||
8e176ce2bd | |||
4ca2d2daed | |||
6581e3d662 | |||
827f23107c | |||
ad917bf2ad | |||
306a018efd | |||
a7935958b7 | |||
8818ca9370 | |||
85b1988383 | |||
10cbf125a9 | |||
d229e0ca37 | |||
f7b260f28b | |||
ba44efe4cc | |||
07718ba618 | |||
0af4e4cfb3 | |||
b54681f063 | |||
37f3df9deb | |||
4b0d99cf3a | |||
38426a24bc | |||
dadd0b70b3 | |||
516b0ff578 | |||
e5fa36fb06 | |||
228756951f | |||
a22c837eac | |||
a1a341b2de | |||
046d3107e8 | |||
956bcdf16e | |||
f61640b65a | |||
0125591149 | |||
6aa0d800b3 | |||
19160170a9 |
@ -12,6 +12,9 @@ stages:
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
@ -19,23 +22,36 @@ mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
audit:
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
@ -50,9 +66,7 @@ testStable:
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
@ -63,9 +77,7 @@ testBuild:
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
@ -85,6 +97,8 @@ release:
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
|
4
.snyk
4
.snyk
@ -1,4 +0,0 @@
|
||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.13.5
|
||||
ignore: {}
|
||||
patch: {}
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${relativeFile}"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": "test.ts",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"test/test.ts"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm"]
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
cli.child.ts
Normal file
4
cli.child.ts
Normal file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
import * as cliTool from './ts/index.js';
|
||||
cliTool.runCli();
|
2
cli.js
2
cli.js
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
const cliTool = require('./dist_ts/index');
|
||||
const cliTool = await import('./dist_ts/index.js');
|
||||
cliTool.runCli();
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('@gitzone/tsrun');
|
||||
const cliTool = require('./ts/index');
|
||||
cliTool.runCli();
|
||||
|
||||
import * as tsrun from '@gitzone/tsrun';
|
||||
tsrun.runPath('./cli.child.js', import.meta.url);
|
||||
|
@ -5,7 +5,7 @@
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "gitzone",
|
||||
"gitrepo": "tsbundle",
|
||||
"shortDescription": "a bundler using rollup for painless bundling of web projects",
|
||||
"description": "a bundler using rollup for painless bundling of web projects",
|
||||
"npmPackagename": "@gitzone/tsbundle",
|
||||
"license": "MIT",
|
||||
"projectDomain": "git.zone"
|
||||
|
22982
package-lock.json
generated
22982
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
59
package.json
59
package.json
@ -1,53 +1,57 @@
|
||||
{
|
||||
"name": "@gitzone/tsbundle",
|
||||
"version": "1.0.74",
|
||||
"version": "1.0.96",
|
||||
"private": false,
|
||||
"description": "a bundler using rollup for painless bundling of web projects",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "cd test && node ../cli.ts.js --production",
|
||||
"test": "npm run build && (tstest test/) && (cd test && node ../cli.js --production)",
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"bin": {
|
||||
"tsbundle": "cli.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.43",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@gitzone/tsbuild": "^2.1.48",
|
||||
"@gitzone/tsrun": "^1.2.31",
|
||||
"@gitzone/tstest": "^1.0.67",
|
||||
"@pushrocks/tapbundle": "^5.0.2",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.1",
|
||||
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
||||
"@babel/plugin-proposal-decorators": "^7.10.5",
|
||||
"@babel/plugin-transform-runtime": "^7.11.0",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
||||
"@babel/plugin-proposal-decorators": "^7.17.2",
|
||||
"@babel/plugin-transform-runtime": "^7.17.0",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@pushrocks/early": "^3.0.6",
|
||||
"@pushrocks/smartcli": "^3.0.12",
|
||||
"@pushrocks/smartfile": "^8.0.0",
|
||||
"@pushrocks/smartlog": "^2.0.36",
|
||||
"@pushrocks/smartcli": "^3.0.14",
|
||||
"@pushrocks/smartfile": "^9.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.44",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
||||
"@pushrocks/smartparcel": "^1.0.5",
|
||||
"@rollup/plugin-commonjs": "^14.0.0",
|
||||
"@pushrocks/smartparcel": "^1.0.13",
|
||||
"@pushrocks/smartpath": "^5.0.4",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@pushrocks/smartspawn": "^2.0.9",
|
||||
"@rollup/plugin-commonjs": "^21.0.2",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^8.4.0",
|
||||
"@rollup/plugin-typescript": "^5.0.2",
|
||||
"@types/html-minifier": "^4.0.0",
|
||||
"@types/node": "^14.0.27",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"@rollup/plugin-typescript": "^8.3.1",
|
||||
"@types/html-minifier": "^4.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"esbuild": "^0.14.27",
|
||||
"html-minifier": "^4.0.0",
|
||||
"rollup": "^2.23.1",
|
||||
"rollup": "^2.70.1",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-sourcemaps": "^0.6.2",
|
||||
"rollup-plugin-terser": "^7.0.0",
|
||||
"terser": "^5.0.0",
|
||||
"typescript": "^3.9.7"
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"typescript": "4.7.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
@ -60,5 +64,8 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
||||
|
28
readme.md
28
readme.md
@ -8,13 +8,20 @@ a bundler using rollup for painless bundling of web projects
|
||||
* [docs (typedoc)](https://gitzone.gitlab.io/tsbundle/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
||||
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
||||
[](https://www.npmjs.com/package/@gitzone/tsbundle)
|
||||
[](https://snyk.io/test/npm/@gitzone/tsbundle)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
||||
@ -44,6 +51,7 @@ tsbundle --from="./ts/index.ts" --to="dist/bundle.js"
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
You are using TypeScript, aren't you? Most of the stuff is apparent from the IDE intellisense.
|
||||
|
||||
```typescript
|
||||
@ -52,10 +60,10 @@ import { TsBundle } from '@gitozne/tsbundle';
|
||||
const myTsBundleInstance = new TsBundle();
|
||||
|
||||
const run = async () => {
|
||||
await myTsBundleInstance.buildTest('./from/my.ts', './to/mybundle.js')
|
||||
await myTsBundleInstance.buildTest('./from/my.ts', './to/mybundle.js');
|
||||
// OR
|
||||
await myTsBundleInstance.buildProduction('./from/my.ts', './to/mybundle.js')
|
||||
}
|
||||
await myTsBundleInstance.buildProduction('./from/my.ts', './to/mybundle.js');
|
||||
};
|
||||
```
|
||||
|
||||
## Contribution
|
||||
|
@ -1,57 +0,0 @@
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import typescript from 'rollup-plugin-typescript2';
|
||||
import json from 'rollup-plugin-json';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
export default {
|
||||
input: `ts_web/index.ts`,
|
||||
output: {
|
||||
name: 'tsbundle',
|
||||
// file: 'dist_web/bundle.js',
|
||||
file: 'dist_web/bundle.js',
|
||||
format: 'iife',
|
||||
sourcemap: true
|
||||
},
|
||||
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
||||
external: [],
|
||||
watch: {
|
||||
include: 'src/**'
|
||||
},
|
||||
plugins: [
|
||||
// Allow json resolution
|
||||
json(),
|
||||
// Compile TypeScript files
|
||||
typescript({ useTsconfigDeclarationDir: true, tsconfigOverride: {
|
||||
compilerOptions: {
|
||||
declaration: true,
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
inlineSourceMap: true,
|
||||
noEmitOnError: true,
|
||||
lib: ['es2016', 'es2017', 'dom'],
|
||||
noImplicitAny: false
|
||||
}
|
||||
} }),
|
||||
// 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
|
||||
resolve(),
|
||||
commonjs({
|
||||
namedExports: {
|
||||
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
|
||||
}
|
||||
}),
|
||||
|
||||
// Resolve source maps to the original source
|
||||
sourceMaps(),
|
||||
babel({
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
babelrc: false,
|
||||
presets: [["@babel/preset-env", { modules: false }]]
|
||||
})
|
||||
]
|
||||
};
|
38
test/test.ts
38
test/test.ts
@ -1,8 +1,40 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as tsbundle from '../ts/index';
|
||||
import * as tsbundle from '../ts/index.js';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
await tsbundle.runCli();
|
||||
import * as path from 'path';
|
||||
|
||||
tap.test('should bundle with esbuild', async () => {
|
||||
const tsbundleInstance = new tsbundle.TsBundle();
|
||||
await tsbundleInstance.build(
|
||||
process.cwd() + '/test',
|
||||
'./ts_web/index.ts',
|
||||
'./dist_manual/test.js',
|
||||
{
|
||||
bundler: 'esbuild'
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
tap.test('should bundle with parcel', async () => {
|
||||
const tsbundleInstance = new tsbundle.TsBundle();
|
||||
await tsbundleInstance.build(
|
||||
process.cwd() + '/test',
|
||||
'./ts_web/index.ts',
|
||||
'./dist_manual/test.js',
|
||||
{
|
||||
bundler: 'parcel'
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
tap.test('should bundle with rollup', async () => {
|
||||
const tsbundleInstance = new tsbundle.TsBundle();
|
||||
await tsbundleInstance.build(
|
||||
process.cwd(),
|
||||
'./test/ts_web/index.ts',
|
||||
'./test/dist_manual/production.js',
|
||||
{bundler: 'rollup'}
|
||||
);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -1,3 +1,18 @@
|
||||
const myConst = 'hello';
|
||||
const myConst: string = 'hello';
|
||||
|
||||
function sealed(constructor: Function) {
|
||||
Object.seal(constructor);
|
||||
Object.seal(constructor.prototype);
|
||||
}
|
||||
|
||||
@sealed
|
||||
class BugReport {
|
||||
type = 'report';
|
||||
title: string;
|
||||
|
||||
constructor(t: string) {
|
||||
this.title = t;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(myConst);
|
||||
|
10
ts/index.ts
10
ts/index.ts
@ -1,13 +1,13 @@
|
||||
import * as early from '@pushrocks/early';
|
||||
early.start('tsbundle');
|
||||
// lets import all plugins beforehand
|
||||
import './tsbundle.plugins';
|
||||
import './plugins.js';
|
||||
|
||||
import { logger } from './tsbundle.logging';
|
||||
import { runCli } from './tsbundle.cli';
|
||||
import { logger } from './tsbundle.logging.js';
|
||||
import { runCli } from './tsbundle.cli.js';
|
||||
early.stop();
|
||||
|
||||
// lets make this usable programmatically
|
||||
export * from './tsbundle.class.tsbundle';
|
||||
export * from './tsbundle.htmlhandler';
|
||||
export * from './tsbundle.class.tsbundle.js';
|
||||
export * from './mod_rollup/htmlhandler.js';
|
||||
export { runCli };
|
||||
|
14
ts/interfaces/index.ts
Normal file
14
ts/interfaces/index.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export interface ICliOptions {
|
||||
commonjs?: boolean;
|
||||
skiplibcheck?: boolean;
|
||||
production?: boolean;
|
||||
bundler: 'parcel' | 'esbuild' | 'rollup'
|
||||
}
|
||||
|
||||
export interface IEnvTransportOptions {
|
||||
cwd: string;
|
||||
from: string;
|
||||
to: string;
|
||||
mode: 'test' | 'production',
|
||||
argv: ICliOptions
|
||||
}
|
72
ts/mod_esbuild/index.child.ts
Normal file
72
ts/mod_esbuild/index.child.ts
Normal file
@ -0,0 +1,72 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as interfaces from '../interfaces/index.js';
|
||||
import { logger } from '../tsbundle.logging.js';
|
||||
|
||||
export class TsBundleProcess {
|
||||
|
||||
constructor() {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the test enviroment
|
||||
*/
|
||||
public async buildTest(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
) {
|
||||
// create a bundle
|
||||
const esbuild = await plugins.esbuild.build({
|
||||
entryPoints: [fromArg],
|
||||
bundle: true,
|
||||
outfile: toArg
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the production environment
|
||||
*/
|
||||
public async buildProduction(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
) {
|
||||
// create a bundle
|
||||
console.log('esbuild specific:');
|
||||
console.log(`from: ${fromArg}`);
|
||||
console.log((`to: ${toArg}`));
|
||||
const esbuild = await plugins.esbuild.build({
|
||||
entryPoints: [fromArg],
|
||||
bundle: true,
|
||||
outfile: toArg
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const run = async () => {
|
||||
console.log('running spawned compilation process');
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(process.env.transportOptions);
|
||||
console.log('bundling with esbuild:');
|
||||
console.log(transportOptions);
|
||||
process.chdir(transportOptions.cwd);
|
||||
console.log(`switched to ${process.cwd()}`);
|
||||
const tsbundleProcessInstance = new TsBundleProcess();
|
||||
if (transportOptions.mode === 'test') {
|
||||
console.log('building for test:')
|
||||
tsbundleProcessInstance.buildTest(
|
||||
plugins.path.join(process.cwd(), transportOptions.from),
|
||||
plugins.path.join(process.cwd(), transportOptions.to),
|
||||
transportOptions.argv
|
||||
);
|
||||
} else {
|
||||
console.log('building for production:')
|
||||
tsbundleProcessInstance.buildProduction(
|
||||
transportOptions.from,
|
||||
transportOptions.to,
|
||||
transportOptions.argv
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
run();
|
7
ts/mod_esbuild/plugins.ts
Normal file
7
ts/mod_esbuild/plugins.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export * from '../plugins.js';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
|
||||
export {
|
||||
esbuild
|
||||
}
|
70
ts/mod_parcel/index.child.ts
Normal file
70
ts/mod_parcel/index.child.ts
Normal file
@ -0,0 +1,70 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as interfaces from '../interfaces/index.js';
|
||||
import { logger } from '../tsbundle.logging.js';
|
||||
|
||||
export class TsBundleProcess {
|
||||
|
||||
constructor() {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the test enviroment
|
||||
*/
|
||||
public async buildTest (
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
) {
|
||||
const parsedPath = plugins.path.parse(toArg);
|
||||
const parcelInstance = new plugins.smartparcel.Parcel(
|
||||
fromArg,
|
||||
parsedPath.dir,
|
||||
parsedPath.base
|
||||
);
|
||||
await parcelInstance.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the production environment
|
||||
*/
|
||||
public async buildProduction (
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
) {
|
||||
// create a bundle
|
||||
const parsedPath = plugins.path.parse(toArg);
|
||||
const parcelInstance = new plugins.smartparcel.Parcel(
|
||||
fromArg,
|
||||
parsedPath.dir,
|
||||
parsedPath.base
|
||||
);
|
||||
await parcelInstance.build();
|
||||
}
|
||||
}
|
||||
|
||||
const run = async () => {
|
||||
console.log('running spawned compilation process');
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(process.env.transportOptions);
|
||||
console.log('bundling with parcel:');
|
||||
console.log(transportOptions);
|
||||
process.chdir(transportOptions.cwd);
|
||||
console.log(`switched to ${process.cwd()}`);
|
||||
const tsbundleProcessInstance = new TsBundleProcess();
|
||||
if (transportOptions.mode === 'test') {
|
||||
tsbundleProcessInstance.buildTest(
|
||||
transportOptions.from,
|
||||
transportOptions.to,
|
||||
transportOptions.argv
|
||||
);
|
||||
} else {
|
||||
tsbundleProcessInstance.buildProduction(
|
||||
transportOptions.from,
|
||||
transportOptions.to,
|
||||
transportOptions.argv
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
run();
|
7
ts/mod_parcel/plugins.ts
Normal file
7
ts/mod_parcel/plugins.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export * from '../plugins.js'
|
||||
|
||||
import * as smartparcel from '@pushrocks/smartparcel';
|
||||
|
||||
export {
|
||||
smartparcel
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './tsbundle.plugins';
|
||||
import * as paths from './tsbundle.paths';
|
||||
import * as plugins from './plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
|
||||
export class HtmlHandler {
|
||||
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
|
||||
@ -31,7 +31,7 @@ export class HtmlHandler {
|
||||
removeAttributeQuotes: true,
|
||||
collapseWhitespace: true,
|
||||
collapseInlineTagWhitespace: true,
|
||||
removeComments: true
|
||||
removeComments: true,
|
||||
});
|
||||
plugins.smartfile.memory.toFsSync(minifiedHtml, targetPathArg);
|
||||
}
|
162
ts/mod_rollup/index.child.ts
Normal file
162
ts/mod_rollup/index.child.ts
Normal file
@ -0,0 +1,162 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as interfaces from '../interfaces/index.js';
|
||||
import { logger } from '../tsbundle.logging.js';
|
||||
|
||||
export class TsBundleProcess {
|
||||
/**
|
||||
* the basic default options for rollup
|
||||
*/
|
||||
public getBaseOptions(
|
||||
fromArg: string = `ts_web/index.ts`,
|
||||
toArg: string = 'dist_bundle/bundle.js',
|
||||
argvArg: any
|
||||
) {
|
||||
logger.log('info', `from: ${fromArg}`);
|
||||
logger.log('info', `to: ${toArg}`);
|
||||
|
||||
const baseOptions: plugins.rollup.RollupOptions = {
|
||||
input: fromArg,
|
||||
output: {
|
||||
name: 'tsbundle',
|
||||
file: toArg,
|
||||
format: 'iife',
|
||||
sourcemap: true,
|
||||
},
|
||||
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
||||
external: [],
|
||||
watch: {
|
||||
include: ['src/**'],
|
||||
},
|
||||
plugins: [
|
||||
// Compile TypeScript files
|
||||
(plugins.rollupTypescript as any)({
|
||||
include: plugins.path.parse(fromArg).dir
|
||||
? plugins.path.parse(fromArg).dir + '/**/*.ts'
|
||||
: '**/*.ts',
|
||||
declaration: false,
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
inlineSourceMap: true,
|
||||
noEmitOnError: true,
|
||||
lib: ['dom'],
|
||||
noImplicitAny: false,
|
||||
target: 'es2020',
|
||||
module: 'es2020',
|
||||
moduleResolution: 'node12',
|
||||
allowSyntheticDefaultImports: true,
|
||||
importsNotUsedAsValues: 'preserve',
|
||||
...(argvArg && argvArg.skiplibcheck
|
||||
? {
|
||||
skipLibCheck: true,
|
||||
}
|
||||
: {}),
|
||||
...(argvArg && argvArg.allowimplicitany
|
||||
? {
|
||||
noImplicitAny: false,
|
||||
}
|
||||
: {}),
|
||||
...(argvArg && argvArg.commonjs
|
||||
? {
|
||||
module: 'commonjs',
|
||||
moduleResolution: 'node',
|
||||
}
|
||||
: {}),
|
||||
}),
|
||||
(plugins.rollupJson as any)(),
|
||||
// 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 as any)({}),
|
||||
|
||||
// Resolve source maps to the original source
|
||||
plugins.rollupSourceMaps(),
|
||||
],
|
||||
};
|
||||
return baseOptions;
|
||||
}
|
||||
|
||||
public getOptionsTest(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
): plugins.rollup.RollupOptions {
|
||||
return this.getBaseOptions(fromArg, toArg, argvArg);
|
||||
}
|
||||
|
||||
public getOptionsProduction(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
): plugins.rollup.RollupOptions {
|
||||
const productionOptions = this.getBaseOptions(fromArg, toArg, argvArg);
|
||||
productionOptions.plugins.push(
|
||||
plugins.rollupTerser({
|
||||
compress: true,
|
||||
mangle: true,
|
||||
})
|
||||
);
|
||||
return productionOptions;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the test enviroment
|
||||
*/
|
||||
public async buildTest(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
argvArg: any
|
||||
) {
|
||||
// create a bundle
|
||||
logger.log('info', `bundling for TEST!`);
|
||||
const buildOptions = this.getOptionsTest(fromArg, toArg, argvArg);
|
||||
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!`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the production environment
|
||||
*/
|
||||
public async buildProduction(fromArg: string, toArg: string, argvArg: any) {
|
||||
// create a bundle
|
||||
logger.log('info', `bundling for PRODUCTION!`);
|
||||
const buildOptions = this.getOptionsProduction(fromArg, toArg, argvArg);
|
||||
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!`);
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
const run = async () => {
|
||||
console.log('running spawned compilation process');
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(process.env.transportOptions);
|
||||
console.log('bundling with rollup:');
|
||||
console.log(transportOptions);
|
||||
process.chdir(transportOptions.cwd);
|
||||
console.log(`switched to ${process.cwd()}`);
|
||||
const tsbundleProcessInstance = new TsBundleProcess();
|
||||
if (transportOptions.mode === 'test') {
|
||||
tsbundleProcessInstance.buildTest(
|
||||
transportOptions.from,
|
||||
transportOptions.to,
|
||||
transportOptions.argv
|
||||
);
|
||||
} else {
|
||||
tsbundleProcessInstance.buildProduction(
|
||||
transportOptions.from,
|
||||
transportOptions.to,
|
||||
transportOptions.argv
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
run();
|
@ -1,16 +1,4 @@
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
|
||||
export { path };
|
||||
|
||||
// pushrocks scope
|
||||
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, smartparcel };
|
||||
export * from '../plugins.js';
|
||||
|
||||
// third party scope
|
||||
import * as rollup from 'rollup';
|
||||
@ -33,5 +21,5 @@ export {
|
||||
rollupSourceMaps,
|
||||
rollupTerser,
|
||||
rollupTypescript,
|
||||
htmlMinifier
|
||||
htmlMinifier,
|
||||
};
|
@ -1,7 +1,10 @@
|
||||
import * as plugins from './tsbundle.plugins';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export const cwd = process.cwd();
|
||||
export const packageDir = plugins.path.join(__dirname, '../');
|
||||
export const packageDir = plugins.path.join(
|
||||
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||
'../'
|
||||
);
|
||||
export const htmlDir = plugins.path.join(cwd, './html');
|
||||
export const distServeDir = plugins.path.join(cwd, './dist_serve');
|
||||
export const assetsDir = plugins.path.join(packageDir, 'assets');
|
23
ts/plugins.ts
Normal file
23
ts/plugins.ts
Normal file
@ -0,0 +1,23 @@
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
|
||||
export { path };
|
||||
|
||||
// pushrocks scope
|
||||
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 smartpath from '@pushrocks/smartpath';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartspawn from '@pushrocks/smartspawn';
|
||||
|
||||
export {
|
||||
smartcli,
|
||||
smartfile,
|
||||
smartlog,
|
||||
smartlogDestinationLocal,
|
||||
smartpath,
|
||||
smartpromise,
|
||||
smartspawn,
|
||||
};
|
@ -1,138 +1,54 @@
|
||||
import * as plugins from './tsbundle.plugins';
|
||||
import { logger } from './tsbundle.logging';
|
||||
import * as plugins from './plugins.js';
|
||||
import * as interfaces from './interfaces/index.js';
|
||||
import { logger } from './tsbundle.logging.js';
|
||||
|
||||
export class TsBundle {
|
||||
/**
|
||||
* the basic default options for rollup
|
||||
*/
|
||||
public getBaseOptions(
|
||||
fromArg: string = `ts_web/index.ts`,
|
||||
toArg: string = 'dist_bundle/bundle.js'
|
||||
|
||||
public async build(
|
||||
cwdArg: string,
|
||||
fromArg: string = './ts_web/index.ts',
|
||||
toArg: string = './dist_bundle/bundle.js',
|
||||
argvArg: interfaces.ICliOptions
|
||||
) {
|
||||
logger.log('info', `from: ${fromArg}`);
|
||||
logger.log('info', `to: ${toArg}`);
|
||||
|
||||
const baseOptions: plugins.rollup.RollupOptions = {
|
||||
input: fromArg,
|
||||
output: {
|
||||
name: 'tsbundle',
|
||||
file: toArg,
|
||||
format: 'iife',
|
||||
sourcemap: true,
|
||||
},
|
||||
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
||||
external: [],
|
||||
watch: {
|
||||
include: ['src/**'],
|
||||
},
|
||||
plugins: [
|
||||
// Compile TypeScript files
|
||||
plugins.rollupTypescript({
|
||||
include: plugins.path.parse(fromArg).dir
|
||||
? plugins.path.parse(fromArg).dir + '/**/*.ts'
|
||||
: '**/*.ts',
|
||||
declaration: false,
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
inlineSourceMap: true,
|
||||
noEmitOnError: true,
|
||||
lib: ['esnext', 'dom', 'es2017.object'],
|
||||
noImplicitAny: false,
|
||||
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({}),
|
||||
|
||||
// Resolve source maps to the original source
|
||||
plugins.rollupSourceMaps(),
|
||||
/*plugins.rollupBabel({
|
||||
runtimeHelpers: true,
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
modules: false,
|
||||
targets: {
|
||||
chrome: '41'
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'@babel/plugin-transform-runtime',
|
||||
{
|
||||
regenerator: true
|
||||
}
|
||||
]
|
||||
]
|
||||
})*/
|
||||
],
|
||||
};
|
||||
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({
|
||||
compress: true,
|
||||
mangle: true
|
||||
})
|
||||
);
|
||||
return productionOptions;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a bundle for the test enviroment
|
||||
*/
|
||||
public async buildTest(
|
||||
fromArg: string,
|
||||
toArg: string,
|
||||
bundlerArg: 'rollup' | 'parcel' = 'rollup'
|
||||
) {
|
||||
// create a bundle
|
||||
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();
|
||||
const done = plugins.smartpromise.defer();
|
||||
const getBundlerPath = () => {
|
||||
if (argvArg.bundler === 'esbuild') {
|
||||
return './mod_esbuild/index.child.js'
|
||||
}
|
||||
if (argvArg.bundler === 'parcel') {
|
||||
return './mod_parcel/index.child.js'
|
||||
}
|
||||
if (argvArg.bundler === 'rollup') {
|
||||
return './mod_rollup/index.child.js'
|
||||
}
|
||||
return './mod_esbuild/index.child.js'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 as plugins.rollup.OutputOptions);
|
||||
await bundle.write(buildOptions.output as plugins.rollup.OutputOptions);
|
||||
logger.log('ok', `Successfully bundled files!`);
|
||||
const transportOptions: interfaces.IEnvTransportOptions = {
|
||||
cwd: cwdArg,
|
||||
from: fromArg,
|
||||
to: toArg,
|
||||
mode: argvArg && argvArg.production ? 'production' : 'test',
|
||||
argv: argvArg ? argvArg : {
|
||||
bundler: 'esbuild'
|
||||
}
|
||||
}
|
||||
const threadsimple = new plugins.smartspawn.ThreadSimple(
|
||||
plugins.path.join(
|
||||
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||
getBundlerPath()
|
||||
),
|
||||
[],
|
||||
{
|
||||
env: {
|
||||
...process.env,
|
||||
transportOptions: JSON.stringify(transportOptions),
|
||||
},
|
||||
}
|
||||
);
|
||||
const childProcess = await threadsimple.start();
|
||||
childProcess.on('exit', (status) => {
|
||||
done.resolve();
|
||||
});
|
||||
await done.promise;
|
||||
}
|
||||
}
|
||||
|
@ -1,72 +1,44 @@
|
||||
import * as plugins from './tsbundle.plugins';
|
||||
import { TsBundle } from './tsbundle.class.tsbundle';
|
||||
import { HtmlHandler } from './tsbundle.htmlhandler';
|
||||
import { logger } from './tsbundle.logging';
|
||||
import * as plugins from './plugins.js';
|
||||
import { TsBundle } from './tsbundle.class.tsbundle.js';
|
||||
import { logger } from './tsbundle.logging.js';
|
||||
|
||||
export const runCli = async () => {
|
||||
const tsBundleCli = new plugins.smartcli.Smartcli();
|
||||
tsBundleCli.standardTask().subscribe(async argvArg => {
|
||||
tsBundleCli.standardTask().subscribe(async (argvArg) => {
|
||||
const tsbundle = new TsBundle();
|
||||
// const htmlHandler = new HtmlHandler();
|
||||
switch (true) {
|
||||
case argvArg.production || process.env.CI:
|
||||
await tsbundle.buildProduction(argvArg.from, argvArg.to);
|
||||
// await htmlHandler.minifyHtml();
|
||||
break;
|
||||
case argvArg.test:
|
||||
default:
|
||||
await tsbundle.buildTest(argvArg.from, argvArg.to);
|
||||
// await htmlHandler.copyHtml();
|
||||
return;
|
||||
}
|
||||
await tsbundle.build(process.cwd(), argvArg.from, argvArg.to, argvArg);
|
||||
return;
|
||||
});
|
||||
|
||||
tsBundleCli.addCommand('element').subscribe(async argvArg => {
|
||||
tsBundleCli.addCommand('element').subscribe(async (argvArg) => {
|
||||
const tsbundle = new TsBundle();
|
||||
// const htmlHandler = new HtmlHandler();
|
||||
switch (true) {
|
||||
case argvArg.production || process.env.CI:
|
||||
await tsbundle.buildProduction('./ts_web/index.ts', './dist_bundle/bundle.js');
|
||||
// await htmlHandler.minifyHtml();
|
||||
break;
|
||||
case argvArg.test:
|
||||
default:
|
||||
await tsbundle.buildTest('./ts_web/index.ts', './dist_bundle/bundle.js');
|
||||
// await htmlHandler.copyHtml();
|
||||
return;
|
||||
}
|
||||
await tsbundle.build(
|
||||
process.cwd(),
|
||||
'./ts_web/index.ts',
|
||||
'./dist_bundle/bundle.js',
|
||||
argvArg
|
||||
);
|
||||
});
|
||||
|
||||
tsBundleCli.addCommand('npm').subscribe(async argvArg => {
|
||||
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;
|
||||
}
|
||||
await tsbundle.build(
|
||||
process.cwd(),
|
||||
'./ts/index.ts',
|
||||
'./dist_bundle/bundle.js',
|
||||
argvArg
|
||||
);
|
||||
});
|
||||
|
||||
tsBundleCli.addCommand('website').subscribe(async argvArg => {
|
||||
tsBundleCli.addCommand('website').subscribe(async (argvArg) => {
|
||||
const tsbundle = new TsBundle();
|
||||
const htmlHandler = new HtmlHandler();
|
||||
switch (true) {
|
||||
case argvArg.production || process.env.CI:
|
||||
await tsbundle.buildProduction('./ts_web/index.ts', './dist_serve/bundle.js');
|
||||
await htmlHandler.minifyHtml();
|
||||
break;
|
||||
case argvArg.test:
|
||||
default:
|
||||
await tsbundle.buildTest('./ts_web/index.ts', './dist_serve/bundle.js');
|
||||
await htmlHandler.copyHtml();
|
||||
return;
|
||||
}
|
||||
await tsbundle.build(
|
||||
process.cwd(),
|
||||
'./ts_web/index.ts',
|
||||
'./dist_serve/bundle.js',
|
||||
argvArg
|
||||
);
|
||||
});
|
||||
|
||||
tsBundleCli.startParse();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './tsbundle.plugins';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export const logger = new plugins.smartlog.Smartlog({
|
||||
logContext: {
|
||||
@ -7,9 +7,9 @@ export const logger = new plugins.smartlog.Smartlog({
|
||||
containerName: 'Some Containername',
|
||||
environment: 'local',
|
||||
runtime: 'node',
|
||||
zone: 'gitzone'
|
||||
zone: 'gitzone',
|
||||
},
|
||||
minimumLogLevel: 'silly'
|
||||
minimumLogLevel: 'silly',
|
||||
});
|
||||
|
||||
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||
|
9
tsconfig.json
Normal file
9
tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "node12",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user