@teambit/preview.cli.webpack-events-listener 0.0.174 → 0.0.176

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.
@@ -1,10 +1,10 @@
1
1
  import { PubsubMain } from '@teambit/pubsub';
2
- export declare type CompilationResult = {
2
+ export type CompilationResult = {
3
3
  errors?: Error[];
4
4
  warnings?: Error[];
5
5
  compiling: boolean;
6
6
  };
7
- export declare type Handlers = {
7
+ export type Handlers = {
8
8
  /**
9
9
  * emitted when compilation completes. Might happen after server is already up and running.
10
10
  */
@@ -8,7 +8,7 @@ const webpack_1 = require("@teambit/webpack");
8
8
  function SubscribeToWebpackEvents(pubsub, handlers = {}) {
9
9
  pubsub.sub(webpack_1.WebpackAspect.id, (event) => {
10
10
  var _a, _b;
11
- if (event instanceof webpack_1.WebpackCompilationDoneEvent) {
11
+ if (event.type === webpack_1.WebpackCompilationDoneEvent.TYPE) {
12
12
  const { stats, devServerID } = event.data;
13
13
  const results = {
14
14
  errors: stats.compilation.errors,
@@ -17,7 +17,7 @@ function SubscribeToWebpackEvents(pubsub, handlers = {}) {
17
17
  };
18
18
  (_a = handlers.onDone) === null || _a === void 0 ? void 0 : _a.call(handlers, devServerID, results);
19
19
  }
20
- if (event instanceof webpack_1.WebpackCompilationStartedEvent) {
20
+ if (event.type === webpack_1.WebpackCompilationStartedEvent.TYPE) {
21
21
  const { devServerID } = event.data;
22
22
  (_b = handlers.onStart) === null || _b === void 0 ? void 0 : _b.call(handlers, devServerID);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-events-listener.js","sourceRoot":"","sources":["../webpack-events-listener.ts"],"names":[],"mappings":";;;AAAA,8CAA8G;AAoB9G;;GAEG;AACH,SAAgB,wBAAwB,CAAC,MAAkB,EAAE,WAAqB,EAAE;IAClF,MAAM,CAAC,GAAG,CAAC,uBAAa,CAAC,EAAE,EAAE,CAAC,KAAwB,EAAE,EAAE;;QACxD,IAAI,KAAK,YAAY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YACvD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;YACnC,MAAA,QAAQ,CAAC,OAAO,yDAAG,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAnBD,4DAmBC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/preview.cli.webpack-events-listener",
3
- "version": "0.0.174",
3
+ "version": "0.0.176",
4
4
  "homepage": "https://bit.cloud/teambit/preview/cli/webpack-events-listener",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.preview",
8
8
  "name": "cli/webpack-events-listener",
9
- "version": "0.0.174"
9
+ "version": "0.0.176"
10
10
  },
11
11
  "dependencies": {},
12
12
  "devDependencies": {
@@ -23,7 +23,7 @@ export type Handlers = {
23
23
  */
24
24
  export function SubscribeToWebpackEvents(pubsub: PubsubMain, handlers: Handlers = {}) {
25
25
  pubsub.sub(WebpackAspect.id, (event: BitBaseEvent<any>) => {
26
- if (event instanceof WebpackCompilationDoneEvent) {
26
+ if (event.type === WebpackCompilationDoneEvent.TYPE) {
27
27
  const { stats, devServerID } = event.data;
28
28
 
29
29
  const results = {
@@ -35,9 +35,8 @@ export function SubscribeToWebpackEvents(pubsub: PubsubMain, handlers: Handlers
35
35
  handlers.onDone?.(devServerID, results);
36
36
  }
37
37
 
38
- if (event instanceof WebpackCompilationStartedEvent) {
38
+ if (event.type === WebpackCompilationStartedEvent.TYPE) {
39
39
  const { devServerID } = event.data;
40
-
41
40
  handlers.onStart?.(devServerID);
42
41
  }
43
42
  });
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable"
8
- ],
9
- "target": "es2015",
10
- "module": "CommonJS",
11
- "jsx": "react",
12
- "allowJs": true,
13
- "composite": true,
14
- "declaration": true,
15
- "sourceMap": true,
16
- "skipLibCheck": true,
17
- "experimentalDecorators": true,
18
- "outDir": "dist",
19
- "moduleResolution": "node",
20
- "esModuleInterop": true,
21
- "rootDir": ".",
22
- "resolveJsonModule": true
23
- },
24
- "exclude": [
25
- "dist",
26
- "package.json"
27
- ],
28
- "include": [
29
- "**/*",
30
- "**/*.json"
31
- ]
32
- }
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable"
8
- ],
9
- "target": "es2015",
10
- "module": "CommonJS",
11
- "jsx": "react",
12
- "allowJs": true,
13
- "composite": true,
14
- "declaration": true,
15
- "sourceMap": true,
16
- "skipLibCheck": true,
17
- "experimentalDecorators": true,
18
- "outDir": "dist",
19
- "moduleResolution": "node",
20
- "esModuleInterop": true,
21
- "rootDir": ".",
22
- "resolveJsonModule": true
23
- },
24
- "exclude": [
25
- "dist",
26
- "package.json"
27
- ],
28
- "include": [
29
- "**/*",
30
- "**/*.json"
31
- ]
32
- }