Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
753225053b | |||
715b7a89ad | |||
166dd28ad3 | |||
ca039552ba | |||
d435c0fdf9 | |||
911523dc6a | |||
1f6917ed45 | |||
d92edd60d9 | |||
acc7936a6a | |||
9785399565 | |||
d1bb93e9e1 | |||
5c00555ea8 | |||
7fd0ff65e5 | |||
0cca5cafdf | |||
f5340e7109 | |||
71c917b32f |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
@ -1,18 +1,16 @@
|
|||||||
# gitzone ci_default
|
# gitzone ci_default
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
variables:
|
|
||||||
GIT_STRATEGY: clone
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -20,21 +18,24 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
audit:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@ -43,37 +44,40 @@ snyk:
|
|||||||
testStable:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
@ -83,33 +87,35 @@ codequality:
|
|||||||
allow_failure: true
|
allow_failure: true
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g tslint typescript
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
|
||||||
services:
|
|
||||||
- docker:18-dind
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
|
- npmci node install lts
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -117,5 +123,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "current file",
|
||||||
|
"type": "node",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
cli.js
2
cli.js
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.CLI_CALL = 'true';
|
process.env.CLI_CALL = 'true';
|
||||||
const cliTool = require('./dist/index');
|
const cliTool = require('./dist_ts/index');
|
||||||
cliTool.runCli();
|
cliTool.runCli();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "gitzone",
|
"gitscope": "gitzone",
|
||||||
|
1979
package-lock.json
generated
1979
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
57
package.json
57
package.json
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.52",
|
"version": "1.0.60",
|
||||||
"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_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -16,44 +16,45 @@
|
|||||||
"tsbundle": "cli.js"
|
"tsbundle": "cli.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.17",
|
"@gitzone/tsbuild": "^2.1.22",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@pushrocks/tapbundle": "^3.2.0",
|
"@pushrocks/tapbundle": "^3.2.1",
|
||||||
"tslint": "^6.0.0",
|
"tslint": "^6.1.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^13.9.0",
|
"@babel/core": "^7.8.7",
|
||||||
"@babel/core": "^7.6.2",
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
"@babel/plugin-proposal-decorators": "^7.8.3",
|
||||||
"@babel/plugin-proposal-decorators": "^7.6.0",
|
"@babel/plugin-transform-runtime": "^7.8.3",
|
||||||
"@babel/plugin-transform-runtime": "^7.6.2",
|
"@babel/preset-env": "^7.8.7",
|
||||||
"@babel/preset-env": "^7.6.2",
|
"@babel/runtime": "^7.8.7",
|
||||||
"@babel/runtime": "^7.6.2",
|
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/smartcli": "^3.0.7",
|
"@pushrocks/smartcli": "^3.0.9",
|
||||||
"@pushrocks/smartfile": "^7.0.8",
|
"@pushrocks/smartfile": "^7.0.11",
|
||||||
"@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-node-resolve": "^7.1.1",
|
||||||
|
"@rollup/plugin-typescript": "^4.0.0",
|
||||||
"@types/html-minifier": "^3.5.3",
|
"@types/html-minifier": "^3.5.3",
|
||||||
|
"@types/node": "^13.9.1",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"rollup": "^1.32.0",
|
"rollup": "^2.1.0",
|
||||||
"rollup-plugin-babel": "^4.3.2",
|
"rollup-plugin-babel": "^4.4.0",
|
||||||
"rollup-plugin-commonjs": "^10.1.0",
|
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
|
||||||
"rollup-plugin-sourcemaps": "^0.5.0",
|
"rollup-plugin-sourcemaps": "^0.5.0",
|
||||||
"rollup-plugin-terser": "^5.2.0",
|
"rollup-plugin-terser": "^5.3.0",
|
||||||
"rollup-plugin-typescript2": "^0.26.0",
|
"terser": "^4.6.7"
|
||||||
"terser": "^4.6.4"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/*",
|
"ts/**/*",
|
||||||
"ts_web/*",
|
"ts_web/**/*",
|
||||||
"dist/*",
|
"dist/**/*",
|
||||||
"dist_web/*",
|
"dist_*/**/*",
|
||||||
"dist_ts_web/*",
|
"dist_ts/**/*",
|
||||||
"assets/*",
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
@ -8,7 +8,7 @@ a bundler using rollup for painless bundling of web projects
|
|||||||
* [docs (typedoc)](https://gitzone.gitlab.io/tsbundle/)
|
* [docs (typedoc)](https://gitzone.gitlab.io/tsbundle/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
||||||
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
[](https://gitlab.com/gitzone/tsbundle/commits/master)
|
||||||
[](https://www.npmjs.com/package/@gitzone/tsbundle)
|
[](https://www.npmjs.com/package/@gitzone/tsbundle)
|
||||||
[](https://snyk.io/test/npm/@gitzone/tsbundle)
|
[](https://snyk.io/test/npm/@gitzone/tsbundle)
|
||||||
@ -27,6 +27,10 @@ tsbundle will bundle modern JavaScript websites in an Google Bot conformant way
|
|||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
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)
|
||||||
|
@ -10,6 +10,4 @@ early.stop();
|
|||||||
// lets make this usable programmatically
|
// lets make this usable programmatically
|
||||||
export * from './tsbundle.class.tsbundle';
|
export * from './tsbundle.class.tsbundle';
|
||||||
export * from './tsbundle.htmlhandler';
|
export * from './tsbundle.htmlhandler';
|
||||||
export {
|
export { runCli };
|
||||||
runCli
|
|
||||||
};
|
|
||||||
|
@ -5,7 +5,10 @@ export class TsBundle {
|
|||||||
/**
|
/**
|
||||||
* the basic default options for rollup
|
* the basic default options for rollup
|
||||||
*/
|
*/
|
||||||
public getBaseOptions(fromArg: string = `ts_web/index.ts`, toArg: string = 'dist_web/bundle.js') {
|
public getBaseOptions(
|
||||||
|
fromArg: string = `ts_web/index.ts`,
|
||||||
|
toArg: string = 'dist_bundle/bundle.js'
|
||||||
|
) {
|
||||||
logger.log('info', `from: ${fromArg}`);
|
logger.log('info', `from: ${fromArg}`);
|
||||||
logger.log('info', `to: ${toArg}`);
|
logger.log('info', `to: ${toArg}`);
|
||||||
|
|
||||||
@ -25,19 +28,14 @@ export class TsBundle {
|
|||||||
plugins: [
|
plugins: [
|
||||||
// Compile TypeScript files
|
// Compile TypeScript files
|
||||||
plugins.rollupTypescript({
|
plugins.rollupTypescript({
|
||||||
useTsconfigDeclarationDir: true,
|
declaration: false,
|
||||||
tsconfigOverride: {
|
emitDecoratorMetadata: true,
|
||||||
compilerOptions: {
|
experimentalDecorators: true,
|
||||||
declaration: true,
|
inlineSourceMap: true,
|
||||||
emitDecoratorMetadata: true,
|
noEmitOnError: true,
|
||||||
experimentalDecorators: true,
|
lib: ['esnext', 'dom', 'es2017.object'],
|
||||||
inlineSourceMap: true,
|
noImplicitAny: false,
|
||||||
noEmitOnError: true,
|
target: 'es2018'
|
||||||
lib: ['esnext', 'dom'],
|
|
||||||
target: 'es2018',
|
|
||||||
noImplicitAny: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
// 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
|
||||||
@ -86,11 +84,13 @@ export class TsBundle {
|
|||||||
|
|
||||||
public getOptionsProduction(fromArg: string, toArg: string): plugins.rollup.RollupOptions {
|
public getOptionsProduction(fromArg: string, toArg: string): plugins.rollup.RollupOptions {
|
||||||
const productionOptions = this.getBaseOptions(fromArg, toArg);
|
const productionOptions = this.getBaseOptions(fromArg, toArg);
|
||||||
productionOptions.plugins.push(plugins.rollupTerser({
|
productionOptions.plugins.push(
|
||||||
compress: true,
|
plugins.rollupTerser({
|
||||||
mangle: true,
|
compress: true,
|
||||||
sourcemap: true
|
mangle: true,
|
||||||
}));
|
sourcemap: true
|
||||||
|
})
|
||||||
|
);
|
||||||
return productionOptions;
|
return productionOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,16 +7,16 @@ export const runCli = async () => {
|
|||||||
const tsBundleCli = new plugins.smartcli.Smartcli();
|
const tsBundleCli = new plugins.smartcli.Smartcli();
|
||||||
tsBundleCli.standardTask().subscribe(async argvArg => {
|
tsBundleCli.standardTask().subscribe(async argvArg => {
|
||||||
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(argvArg.from, argvArg.to);
|
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(argvArg.from, argvArg.to);
|
await tsbundle.buildTest(argvArg.from, argvArg.to);
|
||||||
await htmlHandler.copyHtml();
|
// await htmlHandler.copyHtml();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -26,16 +26,32 @@ export const runCli = async () => {
|
|||||||
// 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('./ts_web/index.ts', './dist_ts_web/bundle.js');
|
await tsbundle.buildProduction('./ts_web/index.ts', './dist_bundle/bundle.js');
|
||||||
// await htmlHandler.minifyHtml();
|
// await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
default:
|
default:
|
||||||
await tsbundle.buildTest('./ts_web/index.ts', './dist_ts_web/bundle.js');
|
await tsbundle.buildTest('./ts_web/index.ts', './dist_bundle/bundle.js');
|
||||||
// await htmlHandler.copyHtml();
|
// await htmlHandler.copyHtml();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
tsBundleCli.startParse();
|
tsBundleCli.startParse();
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@ import * as paths from './tsbundle.paths';
|
|||||||
|
|
||||||
export class HtmlHandler {
|
export class HtmlHandler {
|
||||||
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
|
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
|
||||||
public targetFilePath: string = plugins.path.join(paths.distWebDir, 'index.html');
|
public targetFilePath: string = plugins.path.join(paths.distServeDir, 'index.html');
|
||||||
|
|
||||||
public async checkIfExists() {
|
public async checkIfExists() {
|
||||||
return plugins.smartfile.fs.fileExists(this.sourceFilePath);
|
return plugins.smartfile.fs.fileExists(this.sourceFilePath);
|
||||||
|
@ -3,4 +3,5 @@ import * as plugins from './tsbundle.plugins';
|
|||||||
export const cwd = process.cwd();
|
export const cwd = process.cwd();
|
||||||
export const packageDir = plugins.path.join(__dirname, '../');
|
export const packageDir = plugins.path.join(__dirname, '../');
|
||||||
export const htmlDir = plugins.path.join(cwd, './html');
|
export const htmlDir = plugins.path.join(cwd, './html');
|
||||||
export const distWebDir = plugins.path.join(cwd, './dist_web');
|
export const distServeDir = plugins.path.join(cwd, './dist_serve');
|
||||||
|
export const assetsDir = plugins.path.join(packageDir, 'assets');
|
||||||
|
@ -14,11 +14,11 @@ export { smartcli, smartfile, smartlog, smartlogDestinationLocal };
|
|||||||
// third party scope
|
// third party scope
|
||||||
import * as rollup from 'rollup';
|
import * as rollup from 'rollup';
|
||||||
import rollupBabel from 'rollup-plugin-babel';
|
import rollupBabel from 'rollup-plugin-babel';
|
||||||
import rollupCommonjs from 'rollup-plugin-commonjs';
|
import rollupCommonjs from '@rollup/plugin-commonjs';
|
||||||
import rollupResolve from 'rollup-plugin-node-resolve';
|
import rollupResolve from '@rollup/plugin-node-resolve';
|
||||||
import rollupSourceMaps from 'rollup-plugin-sourcemaps';
|
import rollupSourceMaps from 'rollup-plugin-sourcemaps';
|
||||||
import { terser as rollupTerser } from 'rollup-plugin-terser';
|
import { terser as rollupTerser } from 'rollup-plugin-terser';
|
||||||
import rollupTypescript from 'rollup-plugin-typescript2';
|
import rollupTypescript from '@rollup/plugin-typescript';
|
||||||
|
|
||||||
import * as htmlMinifier from 'html-minifier';
|
import * as htmlMinifier from 'html-minifier';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user