@@ -15,6 +15,10 @@ GLIMMER_MODULE_CONFIG.collections.components.types.push("stylesheet");
15
15
// Default tree hook no-op function.
16
16
const NOOP = ( tree ) => tree ;
17
17
18
+ // Default no-op plugin for templates with no associated CSS Block.
19
+ // `visitors` is used by Ember < 3.0.0. `visitor` is used by Glimmer and Ember >= 3.0.0.
20
+ const NOOP_PLUGIN = { name : 'css-blocks-noop' , visitors : { } , visitor : { } } ;
21
+
18
22
module . exports = {
19
23
name : '@css-blocks/ember-cli' ,
20
24
isDevelopingAddon ( ) { return true ; } ,
@@ -37,7 +41,7 @@ module.exports = {
37
41
// If there is no analyzer or mapping for this template in the transport, don't do anything.
38
42
if ( ! transport ) {
39
43
DEBUG ( `No transport object found found for "${ modulePrefix } ". Skipping rewrite.` ) ;
40
- return { name : 'css-blocks-noop' , visitors : { } } ;
44
+ return NOOP_PLUGIN ;
41
45
}
42
46
43
47
// Woo, shared memory wormhole!...
@@ -46,12 +50,12 @@ module.exports = {
46
50
// If there is no analyzer or mapping for this template in the transport, don't do anything.
47
51
if ( ! analyzer || ! mapping ) {
48
52
DEBUG ( `No mapping object found found for template "${ env . meta . moduleName || env . meta . specifier } ". Skipping rewrite.` ) ;
49
- return { name : 'css-blocks-noop' , visitors : { } } ;
53
+ return NOOP_PLUGIN ;
50
54
}
51
55
52
56
// If no specifier data for this template, pass through silently.
53
57
if ( ! env . meta . moduleName && ! env . meta . specifier ) {
54
- return { name : 'css-blocks-noop' , visitors : { } } ;
58
+ return NOOP_PLUGIN ;
55
59
}
56
60
57
61
// TODO: Write a better `getAnalysis` method on `Analyzer`
@@ -66,7 +70,7 @@ module.exports = {
66
70
// If there is no analysis for this template in any of the transports, don't do anything.
67
71
if ( ! analysis ) {
68
72
DEBUG ( `No analysis found for template "${ env . meta . moduleName || env . meta . specifier } ". Skipping rewrite.` ) ;
69
- return { name : 'css-blocks-noop' , visitors : { } } ;
73
+ return NOOP_PLUGIN ;
70
74
}
71
75
72
76
// If we do have a matching analysis, run the rewriter transforms!
0 commit comments