File tree 2 files changed +6
-3
lines changed
packages/@css-blocks/broccoli
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ export class CSSBlocksAnalyze extends BroccoliPlugin {
75
75
let newFsTree = FSTree . fromEntries ( walkSync . entries ( input ) ) ;
76
76
let diff = this . previousInput . calculatePatch ( newFsTree ) ;
77
77
if ( ! diff . length ) { return ; }
78
+
79
+ // Save the current state of our output dir for future diffs.
80
+ this . previousOutput = FSTree . fromEntries ( walkSync . entries ( output ) ) ;
78
81
FSTree . applyPatch ( input , output , this . previousOutput . calculatePatch ( newFsTree ) ) ;
79
82
this . previousInput = newFsTree ;
80
83
@@ -122,9 +125,6 @@ export class CSSBlocksAnalyze extends BroccoliPlugin {
122
125
}
123
126
}
124
127
125
- // Save the current state of our output dir for future diffs.
126
- this . previousOutput = FSTree . fromEntries ( walkSync . entries ( output ) ) ;
127
-
128
128
// Add each Analysis to the Optimizer.
129
129
this . analyzer . eachAnalysis ( ( a ) => optimizer . addAnalysis ( a . forOptimizer ( options ) ) ) ;
130
130
Original file line number Diff line number Diff line change 1
1
import * as assert from "assert" ;
2
+ import * as fs from "fs" ;
2
3
3
4
import { GlimmerAnalyzer } from "@css-blocks/glimmer" ;
4
5
@@ -80,6 +81,8 @@ describe("Broccoli Analyze Plugin Test", function () {
80
81
} ) ;
81
82
82
83
// Modifications to block files trigger build but result in no output tree changes.
84
+ // Accidental modification of output directory does not make the plugin explode.
85
+ fs . unlinkSync ( output . path ( "src/ui/components/Chrisrng/template.hbs" ) ) ;
83
86
input . write ( {
84
87
src : { ui : { components : { [ entryComponentName ] : {
85
88
"stylesheet.css" : `:scope { color: blue; } .foo { color: yellow; }` ,
You can’t perform that action at this time.
0 commit comments