This repository was archived by the owner on May 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed
Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -142,14 +142,14 @@ let cachedBundle: RollupBundle = null;
142142function createOnWarnFn ( ) {
143143 const previousWarns : { [ key : string ] : boolean } = { } ;
144144
145- return function onWarningMessage ( msg : string ) {
146- if ( msg in previousWarns ) {
145+ return function onWarningMessage ( warning : RollupWarning ) {
146+ if ( warning && warning . message in previousWarns ) {
147147 return ;
148148 }
149- previousWarns [ msg ] = true ;
149+ previousWarns [ warning . message ] = true ;
150150
151- if ( ! ( IGNORE_WARNS . some ( warnIgnore => msg . indexOf ( warnIgnore ) > - 1 ) ) ) {
152- Logger . warn ( `rollup: ${ msg } ` ) ;
151+ if ( ! ( IGNORE_WARNS . some ( warnIgnore => warning . message . indexOf ( warnIgnore ) > - 1 ) ) ) {
152+ Logger . warn ( `rollup: ${ warning . loc . file } has issued a warning: ${ warning . message } ` ) ;
153153 }
154154 } ;
155155}
@@ -177,16 +177,29 @@ export interface RollupConfig {
177177 dest ?: string ;
178178 cache ?: RollupBundle ;
179179 onwarn ?: Function ;
180- }
181-
180+ } ;
182181
183182export interface RollupBundle {
184183 // https://github.com/rollup/rollup/wiki/JavaScript-API
185184 write ?: Function ;
186185 modules : RollupModule [ ] ;
187- }
186+ } ;
188187
189188
190189export interface RollupModule {
191190 id : string ;
192- }
191+ } ;
192+
193+ export interface RollupWarning {
194+ code : string ;
195+ message : string ;
196+ url : string ;
197+ pos : number ;
198+ loc : RollupLocationInfo ;
199+ } ;
200+
201+ export interface RollupLocationInfo {
202+ file : string ;
203+ line : number ;
204+ column : number ;
205+ } ;
You can’t perform that action at this time.
0 commit comments