File tree Expand file tree Collapse file tree 3 files changed +8
-39
lines changed Expand file tree Collapse file tree 3 files changed +8
-39
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
const os = require ( "os" ) ;
3
3
const pty = require ( "node-pty" ) ;
4
- const stripAnsi = require ( "strip-ansi" ) ;
5
4
6
5
class TscError extends Error {
7
6
constructor ( message ) {
@@ -71,31 +70,17 @@ class TscWebpackPlugin {
71
70
72
71
ptyProcess . onData ( ( data ) => {
73
72
if ( isWatch ) {
74
- const str = removeNewLinesAtEnd ( data ) ;
75
- const without = stripAnsi ( str ) ;
76
-
77
- if (
78
- / S t a r t i n g c o m p i l a t i o n i n w a t c h m o d e ...$ / . test ( without ) ||
79
- / S t a r t i n g i n c r e m e n t a l c o m p i l a t i o n ...$ / . test ( without ) ||
80
- / F o u n d 0 e r r o r s . W a t c h i n g f o r f i l e c h a n g e s .$ / . test ( without )
81
- ) {
82
- logger . info ( str ) ;
83
- } else {
84
- if ( / F o u n d [ 1 - 9 ] [ 0 - 9 ] * e r r o r s ? \b ./ . test ( without ) ) {
85
- messages . push ( str ) ;
86
- logger . error ( messages . join ( "" ) ) ;
87
-
88
- messages = [ ] ;
89
- } else {
90
- messages . push ( data ) ;
91
- }
92
- }
73
+ logger . info ( removeNewLinesAtEnd ( data ) ) ;
93
74
} else {
94
75
messages . push ( data ) ;
95
76
}
96
77
} ) ;
97
78
98
- if ( ! isWatch ) {
79
+ if ( isWatch ) {
80
+ ptyProcess . onExit ( ( e ) => {
81
+ process . exit ( e . exitCode ) ;
82
+ } ) ;
83
+ } else {
99
84
logger . info ( "Starting typechecking..." ) ;
100
85
101
86
compiler . hooks . afterEmit . tapPromise ( PLUGIN_NAME , async ( compilation ) => {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " tsc-webpack-plugin" ,
3
- "version" : " 0.0.3 " ,
3
+ "version" : " 0.0.4 " ,
4
4
"description" : " A TypeScript plugin for webpack." ,
5
5
"author" :
" Damian Pieczynski [email protected] " ,
6
6
"main" : " index.js" ,
20
20
"bugs" : {
21
21
"url" : " https://github.com/piecyk/tsc-webpack-plugin/issues"
22
22
},
23
- "peerDependencies" : {
24
- "webpack" : " ^4.0.0 || ^5.0.0"
25
- },
26
23
"dependencies" : {
27
- "node-pty" : " ^0.9.0" ,
28
- "strip-ansi" : " ^6.0.0"
24
+ "node-pty" : " ^0.9.0"
29
25
},
30
26
"devDependencies" : {
31
27
"prettier" : " ^2.1.2"
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- ansi-regex@^5.0.0 :
6
- version "5.0.0"
7
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
8
- integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
9
-
10
5
nan@^2.14.0 :
11
6
version "2.14.2"
12
7
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
@@ -23,10 +18,3 @@ prettier@^2.1.2:
23
18
version "2.1.2"
24
19
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
25
20
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
26
-
27
- strip-ansi@^6.0.0 :
28
- version "6.0.0"
29
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
30
- integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
31
- dependencies :
32
- ansi-regex "^5.0.0"
You can’t perform that action at this time.
0 commit comments