Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print ids for unfinished moduleParsed and shouldTransformCachedModule…
… hooks
- Loading branch information
1 parent
5bd96df
commit 0675bd3
Showing
6 changed files
with
117 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('e'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ import './a.js'; | |
import './b.js'; | ||
import './c.js'; | ||
import './d.js'; | ||
import './e.js'; | ||
console.log('main'); |
105 changes: 105 additions & 0 deletions
105
test/cli/samples/unfulfilled-hook-actions/rollup.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
var path = require('path'); | ||
|
||
function relative(id) { | ||
if (id[0] !== '/') return id; | ||
if (id[0] !== '\\') return id; | ||
return './' + path.relative(process.cwd(), id); | ||
} | ||
|
||
module.exports = { | ||
input: 'main.js', | ||
cache: { | ||
modules: [ | ||
{ | ||
id: './e.js', | ||
ast: { | ||
type: 'Program', | ||
start: 0, | ||
end: 18, | ||
body: [ | ||
{ | ||
type: 'ExpressionStatement', | ||
start: 0, | ||
end: 17, | ||
expression: { | ||
type: 'CallExpression', | ||
start: 0, | ||
end: 16, | ||
callee: { | ||
type: 'MemberExpression', | ||
start: 0, | ||
end: 11, | ||
object: { | ||
type: 'Identifier', | ||
start: 0, | ||
end: 7, | ||
name: 'console' | ||
}, | ||
property: { | ||
type: 'Identifier', | ||
start: 8, | ||
end: 11, | ||
name: 'log' | ||
}, | ||
computed: false, | ||
optional: false | ||
}, | ||
arguments: [ | ||
{ | ||
type: 'Literal', | ||
start: 12, | ||
end: 15, | ||
value: 'e', | ||
raw: "'e'" | ||
} | ||
], | ||
optional: false | ||
} | ||
} | ||
], | ||
sourceType: 'module' | ||
}, | ||
code: "console.log('e');\n", | ||
dependencies: [], | ||
customTransformCache: false, | ||
originalCode: "console.log('e');\n", | ||
originalSourcemap: null, | ||
resolvedIds: {}, | ||
sourcemapChain: [], | ||
transformDependencies: [] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
{ | ||
name: 'buggy-plugin', | ||
resolveId(id) { | ||
if (id.includes('\0')) return; | ||
|
||
// this action will never resolve or reject | ||
if (id.endsWith('c.js')) return new Promise(() => {}); | ||
|
||
return relative(id); | ||
}, | ||
load(id) { | ||
// this action will never resolve or reject | ||
if (id.endsWith('b.js')) return new Promise(() => {}); | ||
}, | ||
transform(code, id) { | ||
// this action will never resolve or reject | ||
if (id.endsWith('a.js')) return new Promise(() => {}); | ||
}, | ||
moduleParsed({ id }) { | ||
// this action will never resolve or reject | ||
if (id.endsWith('d.js')) return new Promise(() => {}); | ||
}, | ||
shouldTransformCachedModule({ id }) { | ||
// this action will never resolve or reject | ||
if (id.endsWith('e.js')) return new Promise(() => {}); | ||
} | ||
} | ||
], | ||
output: { | ||
format: 'es' | ||
} | ||
}; |