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
d4471b4
commit 38b03bc
Showing
7 changed files
with
79 additions
and
37 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 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'); |
65 changes: 65 additions & 0 deletions
65
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,65 @@ | ||
const path = require('path'); | ||
const acorn = require('acorn'); | ||
|
||
function relative(id) { | ||
if (id[0] !== '/') return id; | ||
if (id[0] !== '\\') return id; | ||
return './' + path.relative(process.cwd(), id); | ||
} | ||
|
||
const moduleECode = "console.log('e');\n"; | ||
|
||
module.exports = { | ||
input: 'main.js', | ||
cache: { | ||
modules: [ | ||
{ | ||
id: './e.js', | ||
ast: acorn.parse(moduleECode, { | ||
ecmaVersion: 6, | ||
sourceType: 'module' | ||
}), | ||
code: moduleECode, | ||
dependencies: [], | ||
customTransformCache: false, | ||
originalCode: moduleECode, | ||
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' | ||
} | ||
}; |