@@ -12,16 +12,22 @@ import type EmberAddon from "ember-cli/lib/models/addon";
12
12
import type { AddonImplementation , ThisAddon , Tree } from "ember-cli/lib/models/addon" ;
13
13
import type Project from "ember-cli/lib/models/project" ;
14
14
15
- import { BLOCK_GLOB , CSSBlocksTemplateCompilerPlugin , EmberASTPluginEnvironment } from "./CSSBlocksTemplateCompilerPlugin" ;
15
+ import { BLOCK_GLOB , COMPILED_BLOCK_GLOB , CSSBlocksTemplateCompilerPlugin , EmberASTPluginEnvironment } from "./CSSBlocksTemplateCompilerPlugin" ;
16
16
17
17
const debug = debugGenerator ( "css-blocks:ember" ) ;
18
18
19
19
type Writeable < T > = { - readonly [ P in keyof T ] : T [ P ] } ;
20
20
21
- function withoutCssBlockFiles ( tree : InputNode | undefined ) {
21
+ function withoutCssBlockFiles ( tree : InputNode | undefined , excludeCompiledBlocks = false ) {
22
22
if ( ! tree ) return tree ;
23
+
24
+ const exclude = [ BLOCK_GLOB ] ;
25
+ if ( excludeCompiledBlocks ) {
26
+ exclude . push ( COMPILED_BLOCK_GLOB ) ;
27
+ }
28
+
23
29
return funnel ( tree , {
24
- exclude : [ BLOCK_GLOB ] ,
30
+ exclude,
25
31
} ) ;
26
32
}
27
33
@@ -94,7 +100,7 @@ const EMBER_ADDON: AddonImplementation<CSSBlocksAddon> = {
94
100
// We compile CSS Block files in the template tree, so in the CSS Tree all
95
101
// we need to do is prune them out of the build before the tree gets
96
102
// built.
97
- return withoutCssBlockFiles ( tree ) ;
103
+ return withoutCssBlockFiles ( tree , true ) ;
98
104
} ,
99
105
100
106
postprocessTree ( type , tree ) {
0 commit comments