@atls/webpack-start-server-plugin 0.0.7 → 1.0.1
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/index.d.ts +1 -2
- package/dist/index.js +1 -18
- package/dist/start-server.logger.d.ts +0 -2
- package/dist/start-server.logger.js +1 -6
- package/dist/start-server.plugin.d.ts +2 -5
- package/dist/start-server.plugin.js +9 -14
- package/package.json +22 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/start-server.logger.d.ts.map +0 -1
- package/dist/start-server.logger.js.map +0 -1
- package/dist/start-server.plugin.d.ts.map +0 -1
- package/dist/start-server.plugin.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from './start-server.plugin';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './start-server.plugin.js';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./start-server.plugin"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./start-server.plugin.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { Writable } from 'node:stream';
|
|
3
2
|
export interface StartServerLoggerOptions {
|
|
4
3
|
stdout?: Writable;
|
|
@@ -10,4 +9,3 @@ export declare class StartServerLogger {
|
|
|
10
9
|
info(body: string): void;
|
|
11
10
|
error(error: Error): void;
|
|
12
11
|
}
|
|
13
|
-
//# sourceMappingURL=start-server.logger.d.ts.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartServerLogger = void 0;
|
|
4
|
-
class StartServerLogger {
|
|
1
|
+
export class StartServerLogger {
|
|
5
2
|
options;
|
|
6
3
|
constructor(options = {}) {
|
|
7
4
|
this.options = options;
|
|
@@ -30,5 +27,3 @@ class StartServerLogger {
|
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
exports.StartServerLogger = StartServerLogger;
|
|
34
|
-
//# sourceMappingURL=start-server.logger.js.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type { ChildProcess } from 'node:child_process';
|
|
4
2
|
import type { Writable } from 'node:stream';
|
|
5
3
|
import type webpack from 'webpack';
|
|
6
|
-
import { StartServerLogger } from './start-server.logger';
|
|
4
|
+
import { StartServerLogger } from './start-server.logger.js';
|
|
7
5
|
export interface StartServerPluginOptions {
|
|
8
6
|
stdout?: Writable;
|
|
9
7
|
stderr?: Writable;
|
|
@@ -15,9 +13,8 @@ export declare class StartServerPlugin {
|
|
|
15
13
|
initialized: boolean;
|
|
16
14
|
logger: StartServerLogger;
|
|
17
15
|
constructor(options?: Partial<StartServerPluginOptions>);
|
|
18
|
-
apply
|
|
16
|
+
apply(compiler: webpack.Compiler): void;
|
|
19
17
|
private afterEmit;
|
|
20
18
|
private startServer;
|
|
21
19
|
private runWorker;
|
|
22
20
|
}
|
|
23
|
-
//# sourceMappingURL=start-server.plugin.d.ts.map
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
const start_server_logger_1 = require("./start-server.logger");
|
|
7
|
-
class StartServerPlugin {
|
|
1
|
+
import { fork } from 'node:child_process';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { StartServerLogger } from './start-server.logger.js';
|
|
4
|
+
export class StartServerPlugin {
|
|
8
5
|
options;
|
|
9
6
|
entryFile = null;
|
|
10
7
|
worker = null;
|
|
11
8
|
initialized = false;
|
|
12
9
|
logger;
|
|
13
10
|
constructor(options = {}) {
|
|
14
|
-
this.logger = new
|
|
11
|
+
this.logger = new StartServerLogger(options);
|
|
15
12
|
this.options = options;
|
|
16
13
|
}
|
|
17
|
-
apply
|
|
14
|
+
apply(compiler) {
|
|
18
15
|
compiler.hooks.afterEmit.tapAsync({ name: 'StartServerPlugin' }, this.afterEmit);
|
|
19
|
-
}
|
|
16
|
+
}
|
|
20
17
|
afterEmit = (compilation, callback) => {
|
|
21
18
|
if (!this.initialized) {
|
|
22
19
|
this.initialized = true;
|
|
@@ -31,14 +28,14 @@ class StartServerPlugin {
|
|
|
31
28
|
};
|
|
32
29
|
startServer = (compilation, callback) => {
|
|
33
30
|
this.logger.info('Starting server...');
|
|
34
|
-
this.entryFile =
|
|
31
|
+
this.entryFile = join(compilation.compiler.options.output.path, 'index.js');
|
|
35
32
|
this.runWorker(this.entryFile, (worker) => {
|
|
36
33
|
this.worker = worker;
|
|
37
34
|
callback();
|
|
38
35
|
});
|
|
39
36
|
};
|
|
40
37
|
runWorker(entryFile, callback) {
|
|
41
|
-
const worker =
|
|
38
|
+
const worker = fork(entryFile, [], {
|
|
42
39
|
silent: true,
|
|
43
40
|
});
|
|
44
41
|
if (this.options.stdout) {
|
|
@@ -52,5 +49,3 @@ class StartServerPlugin {
|
|
|
52
49
|
}, 0);
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
|
-
exports.StartServerPlugin = StartServerPlugin;
|
|
56
|
-
//# sourceMappingURL=start-server.plugin.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atls/webpack-start-server-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./package.json": "./package.json",
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
5
14
|
"main": "dist/index.js",
|
|
6
15
|
"files": [
|
|
7
16
|
"dist"
|
|
@@ -12,15 +21,23 @@
|
|
|
12
21
|
"postpack": "rm -rf dist"
|
|
13
22
|
},
|
|
14
23
|
"dependencies": {
|
|
15
|
-
"webpack": "5.
|
|
24
|
+
"webpack": "5.97.1"
|
|
16
25
|
},
|
|
17
26
|
"devDependencies": {
|
|
18
|
-
"@types/node": "
|
|
27
|
+
"@types/node": "22.9.0"
|
|
19
28
|
},
|
|
20
29
|
"publishConfig": {
|
|
21
30
|
"access": "public",
|
|
31
|
+
"exports": {
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
".": {
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
22
39
|
"main": "dist/index.js",
|
|
23
|
-
"
|
|
40
|
+
"types": "dist/index.d.ts"
|
|
24
41
|
},
|
|
25
|
-
"
|
|
42
|
+
"types": "dist/index.d.ts"
|
|
26
43
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-server.logger.d.ts","sourceRoot":"","sources":["../src/start-server.logger.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,GAAE,wBAA6B;IAEnE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAgBxB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CAgB1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-server.logger.js","sourceRoot":"","sources":["../src/start-server.logger.ts"],"names":[],"mappings":";;;AAOA,MAAa,iBAAiB;IACC;IAA7B,YAA6B,UAAoC,EAAE;QAAtC,YAAO,GAAP,OAAO,CAA+B;IAAG,CAAC;IAEvE,IAAI,CAAC,IAAY;QACf,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CACvB,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI;gBACJ,cAAc,EAAE,CAAC;gBACjB,UAAU,EAAE;oBACV,YAAY,EAAE,sBAAs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