File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
playground/transform-plugin Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,17 @@ let transformCount = 1
7
7
const transformPlugin = {
8
8
name : 'transform' ,
9
9
load ( id ) {
10
- if ( id === file ) {
10
+ if ( id === file && typeof this . addWatchFile === 'function' ) {
11
11
// Ensure `index.js` is reloaded if 'plugin-dep-load.js' is changed
12
12
this . addWatchFile ( './plugin-dep-load.js' )
13
13
}
14
14
} ,
15
15
transform ( code , id ) {
16
16
if ( id === file ) {
17
- // Ensure `index.js` is reevaluated if 'plugin-dep.js' is changed
18
- this . addWatchFile ( './plugin-dep.js' )
17
+ if ( typeof this . addWatchFile === 'function' ) {
18
+ // Ensure `index.js` is reevaluated if 'plugin-dep.js' is changed
19
+ this . addWatchFile ( './plugin-dep.js' )
20
+ }
19
21
20
22
return `
21
23
// Inject TRANSFORM_COUNT
You can’t perform that action at this time.
0 commit comments