mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
importer is undefined for entry modules
https://github.com/rollup/rollup/blob/master/src/Bundle.js#L116
This commit is contained in:
Vendored
+1
-1
@@ -135,7 +135,7 @@ export interface Plugin {
|
||||
* Returning null or undefined defers to other resolveId functions (and eventually the default resolution behavior);
|
||||
* returning any other falsy value signals that importee should be treated as an external module and not included in the bundle.
|
||||
*/
|
||||
resolveId?(importee: string, importer: string): string | null | undefined | false | 0 | ''
|
||||
resolveId?(importee: string, importer: string | undefined): string | null | undefined | false | 0 | ''
|
||||
/** A module transformer function */
|
||||
transform?(this: TransformContext, source: string, id: string): string | { code: string, map: SourceMap }
|
||||
/** A bundle transformer function */
|
||||
|
||||
@@ -5,6 +5,12 @@ declare const console: { log(...messages: any[]): void, warn(message: string): v
|
||||
let cache: Bundle | undefined
|
||||
const plugin: Plugin = {
|
||||
name: 'test-plugin',
|
||||
resolveId(importee, importer) {
|
||||
if (importer === undefined) {
|
||||
return 'custom/entry/point.js'
|
||||
}
|
||||
return importer.trim()
|
||||
},
|
||||
transform(source, id) {
|
||||
if (id === 'rxjs') {
|
||||
this.error(new Error(`Don't import this directly`))
|
||||
|
||||
Reference in New Issue
Block a user