@git.zone/tsbundle 2.2.8 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/interfaces/index.d.ts +1 -1
- package/dist_ts/mod_esbuild/index.child.js +2 -2
- package/dist_ts/{mod_parcel → mod_rolldown}/index.child.d.ts +1 -0
- package/dist_ts/mod_rolldown/index.child.js +95 -0
- package/dist_ts/mod_rolldown/plugins.d.ts +3 -0
- package/dist_ts/mod_rolldown/plugins.js +4 -0
- package/dist_ts/mod_rspack/index.child.d.ts +12 -0
- package/dist_ts/mod_rspack/index.child.js +210 -0
- package/dist_ts/mod_rspack/plugins.d.ts +3 -0
- package/dist_ts/mod_rspack/plugins.js +4 -0
- package/dist_ts/tsbundle.class.tsbundle.js +9 -5
- package/package.json +5 -3
- package/readme.hints.md +49 -0
- package/readme.plan.md +112 -0
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/interfaces/index.ts +1 -1
- package/ts/mod_esbuild/index.child.ts +1 -1
- package/ts/mod_rolldown/index.child.ts +115 -0
- package/ts/mod_rolldown/plugins.ts +5 -0
- package/ts/mod_rspack/index.child.ts +236 -0
- package/ts/mod_rspack/plugins.ts +5 -0
- package/ts/tsbundle.class.tsbundle.ts +8 -4
- package/dist_ts/mod_parcel/index.child.js +0 -42
- package/dist_ts/mod_parcel/plugins.d.ts +0 -3
- package/dist_ts/mod_parcel/plugins.js +0 -4
- package/dist_ts/mod_rollup/htmlhandler.d.ts +0 -7
- package/dist_ts/mod_rollup/htmlhandler.js +0 -37
- package/dist_ts/mod_rollup/index.child.d.ts +0 -18
- package/dist_ts/mod_rollup/index.child.js +0 -128
- package/dist_ts/mod_rollup/plugins.d.ts +0 -10
- package/dist_ts/mod_rollup/plugins.js +0 -12
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/tsbundle',
|
|
6
|
-
version: '2.
|
|
7
|
-
description: 'a bundler
|
|
6
|
+
version: '2.4.0',
|
|
7
|
+
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
|
|
8
8
|
}
|
package/ts/interfaces/index.ts
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import * as paths from '../paths.js';
|
|
3
|
+
import * as interfaces from '../interfaces/index.js';
|
|
4
|
+
import { logger } from '../tsbundle.logging.js';
|
|
5
|
+
|
|
6
|
+
export class TsBundleProcess {
|
|
7
|
+
constructor() {
|
|
8
|
+
// Nothing here
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async getAliases() {
|
|
12
|
+
try {
|
|
13
|
+
const aliasObject: Record<string, string> = {};
|
|
14
|
+
const localTsConfig = plugins.smartfile.fs.toObjectSync(
|
|
15
|
+
plugins.path.join(paths.cwd, 'tsconfig.json')
|
|
16
|
+
);
|
|
17
|
+
if (localTsConfig.compilerOptions && localTsConfig.compilerOptions.paths) {
|
|
18
|
+
for (const alias of Object.keys(localTsConfig.compilerOptions.paths)) {
|
|
19
|
+
const aliasPath = localTsConfig.compilerOptions.paths[alias][0];
|
|
20
|
+
aliasObject[alias] = aliasPath;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return aliasObject;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* creates a bundle for the test enviroment
|
|
31
|
+
*/
|
|
32
|
+
public async buildTest(fromArg: string, toArg: string, argvArg: any) {
|
|
33
|
+
// create a bundle
|
|
34
|
+
const result = await plugins.rolldown({
|
|
35
|
+
input: fromArg,
|
|
36
|
+
resolve: {
|
|
37
|
+
alias: await this.getAliases(),
|
|
38
|
+
tsconfigFilename: paths.tsconfigPath,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const outputDir = plugins.path.dirname(toArg);
|
|
43
|
+
const outputFilename = plugins.path.basename(toArg);
|
|
44
|
+
|
|
45
|
+
await result.write({
|
|
46
|
+
dir: outputDir,
|
|
47
|
+
entryFileNames: outputFilename,
|
|
48
|
+
format: 'es',
|
|
49
|
+
sourcemap: true,
|
|
50
|
+
inlineDynamicImports: true,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* creates a bundle for the production environment
|
|
56
|
+
*/
|
|
57
|
+
public async buildProduction(fromArg: string, toArg: string, argvArg: any) {
|
|
58
|
+
// create a bundle
|
|
59
|
+
console.log('rolldown specific:');
|
|
60
|
+
console.log(`from: ${fromArg}`);
|
|
61
|
+
console.log(`to: ${toArg}`);
|
|
62
|
+
|
|
63
|
+
const result = await plugins.rolldown({
|
|
64
|
+
input: fromArg,
|
|
65
|
+
resolve: {
|
|
66
|
+
alias: await this.getAliases(),
|
|
67
|
+
tsconfigFilename: paths.tsconfigPath,
|
|
68
|
+
},
|
|
69
|
+
experimental: {
|
|
70
|
+
enableComposingJsPlugins: true,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const outputDir = plugins.path.dirname(toArg);
|
|
75
|
+
const outputFilename = plugins.path.basename(toArg);
|
|
76
|
+
|
|
77
|
+
await result.write({
|
|
78
|
+
dir: outputDir,
|
|
79
|
+
entryFileNames: outputFilename,
|
|
80
|
+
format: 'es',
|
|
81
|
+
sourcemap: true,
|
|
82
|
+
minify: true,
|
|
83
|
+
inlineDynamicImports: true,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const run = async () => {
|
|
89
|
+
console.log('running spawned compilation process');
|
|
90
|
+
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(
|
|
91
|
+
process.env.transportOptions
|
|
92
|
+
);
|
|
93
|
+
console.log('=======> ROLLDOWN');
|
|
94
|
+
console.log(transportOptions);
|
|
95
|
+
process.chdir(transportOptions.cwd);
|
|
96
|
+
console.log(`switched to ${process.cwd()}`);
|
|
97
|
+
const tsbundleProcessInstance = new TsBundleProcess();
|
|
98
|
+
if (transportOptions.mode === 'test') {
|
|
99
|
+
console.log('building for test:');
|
|
100
|
+
await tsbundleProcessInstance.buildTest(
|
|
101
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
|
102
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
|
103
|
+
transportOptions.argv
|
|
104
|
+
);
|
|
105
|
+
} else {
|
|
106
|
+
console.log('building for production:');
|
|
107
|
+
await tsbundleProcessInstance.buildProduction(
|
|
108
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
|
109
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
|
110
|
+
transportOptions.argv
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
run();
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import * as paths from '../paths.js';
|
|
3
|
+
import * as interfaces from '../interfaces/index.js';
|
|
4
|
+
import { logger } from '../tsbundle.logging.js';
|
|
5
|
+
|
|
6
|
+
export class TsBundleProcess {
|
|
7
|
+
constructor() {
|
|
8
|
+
// Nothing here
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async getAliases() {
|
|
12
|
+
try {
|
|
13
|
+
const aliasObject: Record<string, string> = {};
|
|
14
|
+
const localTsConfig = plugins.smartfile.fs.toObjectSync(
|
|
15
|
+
plugins.path.join(paths.cwd, 'tsconfig.json')
|
|
16
|
+
);
|
|
17
|
+
if (localTsConfig.compilerOptions && localTsConfig.compilerOptions.paths) {
|
|
18
|
+
for (const alias of Object.keys(localTsConfig.compilerOptions.paths)) {
|
|
19
|
+
const aliasPath = localTsConfig.compilerOptions.paths[alias][0];
|
|
20
|
+
// Convert TypeScript path to absolute path for rspack
|
|
21
|
+
aliasObject[alias.replace('/*', '')] = plugins.path.resolve(paths.cwd, aliasPath.replace('/*', ''));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return aliasObject;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* creates a bundle for the test enviroment
|
|
32
|
+
*/
|
|
33
|
+
public async buildTest(fromArg: string, toArg: string, argvArg: any) {
|
|
34
|
+
const aliases = await this.getAliases();
|
|
35
|
+
const outputDir = plugins.path.dirname(toArg);
|
|
36
|
+
const outputFilename = plugins.path.basename(toArg);
|
|
37
|
+
|
|
38
|
+
const config = {
|
|
39
|
+
mode: 'development' as const,
|
|
40
|
+
entry: {
|
|
41
|
+
main: fromArg,
|
|
42
|
+
},
|
|
43
|
+
output: {
|
|
44
|
+
path: outputDir,
|
|
45
|
+
filename: outputFilename,
|
|
46
|
+
library: {
|
|
47
|
+
type: 'module' as const,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
devtool: 'source-map' as const,
|
|
51
|
+
resolve: {
|
|
52
|
+
alias: aliases,
|
|
53
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
54
|
+
},
|
|
55
|
+
module: {
|
|
56
|
+
rules: [
|
|
57
|
+
{
|
|
58
|
+
test: /\.tsx?$/,
|
|
59
|
+
exclude: /node_modules/,
|
|
60
|
+
use: {
|
|
61
|
+
loader: 'builtin:swc-loader',
|
|
62
|
+
options: {
|
|
63
|
+
jsc: {
|
|
64
|
+
parser: {
|
|
65
|
+
syntax: 'typescript',
|
|
66
|
+
tsx: true,
|
|
67
|
+
decorators: true,
|
|
68
|
+
},
|
|
69
|
+
target: 'es2022',
|
|
70
|
+
transform: {
|
|
71
|
+
decoratorVersion: '2022-03',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
type: 'javascript/auto',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
experiments: {
|
|
81
|
+
outputModule: true,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return new Promise((resolve, reject) => {
|
|
86
|
+
plugins.rspack(config, (err, stats) => {
|
|
87
|
+
if (err) {
|
|
88
|
+
console.error(err.stack || err);
|
|
89
|
+
reject(err);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (stats.hasErrors()) {
|
|
94
|
+
console.error(stats.toString());
|
|
95
|
+
reject(new Error('Build failed with errors'));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
console.log(stats.toString({
|
|
100
|
+
colors: true,
|
|
101
|
+
modules: false,
|
|
102
|
+
children: false,
|
|
103
|
+
chunks: false,
|
|
104
|
+
chunkModules: false,
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
resolve(undefined);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* creates a bundle for the production environment
|
|
114
|
+
*/
|
|
115
|
+
public async buildProduction(fromArg: string, toArg: string, argvArg: any) {
|
|
116
|
+
console.log('rspack specific:');
|
|
117
|
+
console.log(`from: ${fromArg}`);
|
|
118
|
+
console.log(`to: ${toArg}`);
|
|
119
|
+
|
|
120
|
+
const aliases = await this.getAliases();
|
|
121
|
+
const outputDir = plugins.path.dirname(toArg);
|
|
122
|
+
const outputFilename = plugins.path.basename(toArg);
|
|
123
|
+
|
|
124
|
+
const config = {
|
|
125
|
+
mode: 'production' as const,
|
|
126
|
+
entry: {
|
|
127
|
+
main: fromArg,
|
|
128
|
+
},
|
|
129
|
+
output: {
|
|
130
|
+
path: outputDir,
|
|
131
|
+
filename: outputFilename,
|
|
132
|
+
library: {
|
|
133
|
+
type: 'module' as const,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
devtool: 'source-map' as const,
|
|
137
|
+
resolve: {
|
|
138
|
+
alias: aliases,
|
|
139
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
140
|
+
},
|
|
141
|
+
module: {
|
|
142
|
+
rules: [
|
|
143
|
+
{
|
|
144
|
+
test: /\.tsx?$/,
|
|
145
|
+
exclude: /node_modules/,
|
|
146
|
+
use: {
|
|
147
|
+
loader: 'builtin:swc-loader',
|
|
148
|
+
options: {
|
|
149
|
+
jsc: {
|
|
150
|
+
parser: {
|
|
151
|
+
syntax: 'typescript',
|
|
152
|
+
tsx: true,
|
|
153
|
+
decorators: true,
|
|
154
|
+
},
|
|
155
|
+
target: 'es2022',
|
|
156
|
+
transform: {
|
|
157
|
+
decoratorVersion: '2022-03',
|
|
158
|
+
},
|
|
159
|
+
minify: {
|
|
160
|
+
compress: true,
|
|
161
|
+
mangle: true,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
type: 'javascript/auto',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
optimization: {
|
|
171
|
+
minimize: true,
|
|
172
|
+
concatenateModules: true,
|
|
173
|
+
usedExports: true,
|
|
174
|
+
sideEffects: true,
|
|
175
|
+
},
|
|
176
|
+
experiments: {
|
|
177
|
+
outputModule: true,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
plugins.rspack(config, (err, stats) => {
|
|
183
|
+
if (err) {
|
|
184
|
+
console.error(err.stack || err);
|
|
185
|
+
reject(err);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (stats.hasErrors()) {
|
|
190
|
+
console.error(stats.toString());
|
|
191
|
+
reject(new Error('Build failed with errors'));
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
console.log(stats.toString({
|
|
196
|
+
colors: true,
|
|
197
|
+
modules: false,
|
|
198
|
+
children: false,
|
|
199
|
+
chunks: false,
|
|
200
|
+
chunkModules: false,
|
|
201
|
+
}));
|
|
202
|
+
|
|
203
|
+
resolve(undefined);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const run = async () => {
|
|
210
|
+
console.log('running spawned compilation process');
|
|
211
|
+
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(
|
|
212
|
+
process.env.transportOptions
|
|
213
|
+
);
|
|
214
|
+
console.log('=======> RSPACK');
|
|
215
|
+
console.log(transportOptions);
|
|
216
|
+
process.chdir(transportOptions.cwd);
|
|
217
|
+
console.log(`switched to ${process.cwd()}`);
|
|
218
|
+
const tsbundleProcessInstance = new TsBundleProcess();
|
|
219
|
+
if (transportOptions.mode === 'test') {
|
|
220
|
+
console.log('building for test:');
|
|
221
|
+
await tsbundleProcessInstance.buildTest(
|
|
222
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
|
223
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
|
224
|
+
transportOptions.argv
|
|
225
|
+
);
|
|
226
|
+
} else {
|
|
227
|
+
console.log('building for production:');
|
|
228
|
+
await tsbundleProcessInstance.buildProduction(
|
|
229
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
|
230
|
+
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
|
231
|
+
transportOptions.argv
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
run();
|
|
@@ -12,10 +12,15 @@ export class TsBundle {
|
|
|
12
12
|
) {
|
|
13
13
|
const done = plugins.smartpromise.defer();
|
|
14
14
|
const getBundlerPath = () => {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
switch (argvArg.bundler) {
|
|
16
|
+
case 'rolldown':
|
|
17
|
+
return './mod_rolldown/index.child.js';
|
|
18
|
+
case 'rspack':
|
|
19
|
+
return './mod_rspack/index.child.js';
|
|
20
|
+
case 'esbuild':
|
|
21
|
+
default:
|
|
22
|
+
return './mod_esbuild/index.child.js';
|
|
17
23
|
}
|
|
18
|
-
return './mod_esbuild/index.child.js'
|
|
19
24
|
}
|
|
20
25
|
const transportOptions: interfaces.IEnvTransportOptions = {
|
|
21
26
|
cwd: cwdArg,
|
|
@@ -23,7 +28,6 @@ export class TsBundle {
|
|
|
23
28
|
to: toArg,
|
|
24
29
|
mode: argvArg && argvArg.production ? 'production' : 'test',
|
|
25
30
|
argv: {
|
|
26
|
-
bundler: 'esbuild',
|
|
27
31
|
...argvArg
|
|
28
32
|
}
|
|
29
33
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as plugins from './plugins.js';
|
|
2
|
-
import '../interfaces/index.js';
|
|
3
|
-
import '../tsbundle.logging.js';
|
|
4
|
-
export class TsBundleProcess {
|
|
5
|
-
constructor() {
|
|
6
|
-
// Nothing here
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* creates a bundle for the test enviroment
|
|
10
|
-
*/
|
|
11
|
-
async buildTest(fromArg, toArg, argvArg) {
|
|
12
|
-
const parsedPath = plugins.path.parse(toArg);
|
|
13
|
-
const parcelInstance = new plugins.smartparcel.Parcel(fromArg, parsedPath.dir, parsedPath.base);
|
|
14
|
-
await parcelInstance.build();
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* creates a bundle for the production environment
|
|
18
|
-
*/
|
|
19
|
-
async buildProduction(fromArg, toArg, argvArg) {
|
|
20
|
-
// create a bundle
|
|
21
|
-
const parsedPath = plugins.path.parse(toArg);
|
|
22
|
-
const parcelInstance = new plugins.smartparcel.Parcel(fromArg, parsedPath.dir, parsedPath.base);
|
|
23
|
-
await parcelInstance.build();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const run = async () => {
|
|
27
|
-
console.log('running spawned compilation process');
|
|
28
|
-
const transportOptions = JSON.parse(process.env.transportOptions);
|
|
29
|
-
console.log('bundling with parcel:');
|
|
30
|
-
console.log(transportOptions);
|
|
31
|
-
process.chdir(transportOptions.cwd);
|
|
32
|
-
console.log(`switched to ${process.cwd()}`);
|
|
33
|
-
const tsbundleProcessInstance = new TsBundleProcess();
|
|
34
|
-
if (transportOptions.mode === 'test') {
|
|
35
|
-
tsbundleProcessInstance.buildTest(transportOptions.from, transportOptions.to, transportOptions.argv);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
tsbundleProcessInstance.buildProduction(transportOptions.from, transportOptions.to, transportOptions.argv);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
run();
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguY2hpbGQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfcGFyY2VsL2luZGV4LmNoaWxkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sY0FBYyxDQUFDO0FBQ3hDLE9BQTRCLHdCQUF3QixDQUFDO0FBQ3JELE9BQXVCLHdCQUF3QixDQUFDO0FBRWhELE1BQU0sT0FBTyxlQUFlO0lBRTFCO1FBQ0UsZUFBZTtJQUNqQixDQUFDO0lBRUQ7O09BRUc7SUFDSSxLQUFLLENBQUMsU0FBUyxDQUNwQixPQUFlLEVBQ2YsS0FBYSxFQUNiLE9BQVk7UUFFWixNQUFNLFVBQVUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUM3QyxNQUFNLGNBQWMsR0FBRyxJQUFJLE9BQU8sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUNuRCxPQUFPLEVBQ1AsVUF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EdBQUcsSUFBSSxlQUFlLEVBQUUsQ0FBQztJQUN0RCxJQUFJLGdCQUFnQixDQUFDLElBQUksS0FBSyxNQUFNLEVBQUU7UUFDcEMsdUJBQXVCLENBQUMsU0FBUyxDQUMvQixnQkFBZ0IsQ0FBQyxJQUFJLEVBQ3JCLGdCQUFnQixDQUFDLEVBQUUsRUFDbkIsZ0JBQWdCLENBQUMsSUFBSSxDQUN0QixDQUFDO0tBQ0g7U0FBTTtRQUNMLHVCQUF1QixDQUFDLGVBQWUsQ0FDckMsZ0JBQWdCLENBQUMsSUFBSSxFQUNyQixnQkFBZ0IsQ0FBQyxFQUFFLEVBQ25CLGdCQUFnQixDQUFDLElBQUksQ0FDdEIsQ0FBQztLQUNIO0FBQ0gsQ0FBQyxDQUFDO0FBRUYsR0FBRyxFQUFFLENBQUMifQ==
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from '../plugins.js';
|
|
2
|
-
import * as smartparcel from '@pushrocks/smartparcel';
|
|
3
|
-
export { smartparcel };
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL21vZF9wYXJjZWwvcGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQTtBQUU3QixPQUFPLEtBQUssV0FBVyxNQUFNLHdCQUF3QixDQUFDO0FBRXRELE9BQU8sRUFDTCxXQUFXLEVBQ1osQ0FBQSJ9
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as plugins from './plugins.js';
|
|
2
|
-
import * as paths from '../paths.js';
|
|
3
|
-
export class HtmlHandler {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.sourceFilePath = plugins.path.join(paths.htmlDir, 'index.html');
|
|
6
|
-
this.targetFilePath = plugins.path.join(paths.distServeDir, 'index.html');
|
|
7
|
-
}
|
|
8
|
-
async checkIfExists() {
|
|
9
|
-
return plugins.smartfile.fs.fileExists(this.sourceFilePath);
|
|
10
|
-
}
|
|
11
|
-
// copies the html
|
|
12
|
-
async copyHtml(targetPathArg = this.targetFilePath) {
|
|
13
|
-
if (!(await this.checkIfExists())) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
await plugins.smartfile.fs.copy(this.sourceFilePath, targetPathArg);
|
|
17
|
-
}
|
|
18
|
-
// copies and minifies the html
|
|
19
|
-
async minifyHtml(targetPathArg = this.targetFilePath) {
|
|
20
|
-
if (!(await this.checkIfExists())) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
|
|
24
|
-
const minifiedHtml = plugins.htmlMinifier.minify(fileString, {
|
|
25
|
-
minifyCSS: true,
|
|
26
|
-
minifyJS: true,
|
|
27
|
-
sortAttributes: true,
|
|
28
|
-
sortClassName: true,
|
|
29
|
-
removeAttributeQuotes: true,
|
|
30
|
-
collapseWhitespace: true,
|
|
31
|
-
collapseInlineTagWhitespace: true,
|
|
32
|
-
removeComments: true,
|
|
33
|
-
});
|
|
34
|
-
plugins.smartfile.memory.toFsSync(minifiedHtml, targetPathArg);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbGhhbmRsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2Rfcm9sbHVwL2h0bWxoYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sY0FBYyxDQUFDO0FBQ3hDLE9BQU8sS0FBSyxLQUFLLE1BQU0sYUFBYSxDQUFDO0FBRXJDLE1BQU0sT0FBTyxXQUFXO0lBQXhCO1FBQ1MsbUJBQWMsR0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M0QsU0FBUyxFQUFFLElBQUk7WUFDZixRQUFRLEVBQUUsSUFBSTtZQUNkLGNBQWMsRUFBRSxJQUFJO1lBQ3BCLGFBQWEsRUFBRSxJQUFJO1lBQ25CLHFCQUFxQixFQUFFLElBQUk7WUFDM0Isa0JBQWtCLEVBQUUsSUFBSTtZQUN4QiwyQkFBMkIsRUFBRSxJQUFJO1lBQ2pDLGNBQWMsRUFBRSxJQUFJO1NBQ3JCLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxZQUFZLEVBQUUsYUFBYSxDQUFDLENBQUM7SUFDakUsQ0FBQztDQUNGIn0=
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as plugins from './plugins.js';
|
|
2
|
-
export declare class TsBundleProcess {
|
|
3
|
-
/**
|
|
4
|
-
* the basic default options for rollup
|
|
5
|
-
*/
|
|
6
|
-
getBaseOptions(fromArg: string, toArg: string, argvArg: any): plugins.rollup.RollupOptions;
|
|
7
|
-
getOptionsTest(fromArg: string, toArg: string, argvArg: any): plugins.rollup.RollupOptions;
|
|
8
|
-
getOptionsProduction(fromArg: string, toArg: string, argvArg: any): plugins.rollup.RollupOptions;
|
|
9
|
-
constructor();
|
|
10
|
-
/**
|
|
11
|
-
* creates a bundle for the test enviroment
|
|
12
|
-
*/
|
|
13
|
-
buildTest(fromArg: string, toArg: string, argvArg: any): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* creates a bundle for the production environment
|
|
16
|
-
*/
|
|
17
|
-
buildProduction(fromArg: string, toArg: string, argvArg: any): Promise<void>;
|
|
18
|
-
}
|