@@ -5,12 +5,63 @@ import type { OptiCSSOptions } from "opticss";
5
5
6
6
type Writeable < T > = { - readonly [ P in keyof T ] : T [ P ] } ;
7
7
8
+ /**
9
+ * Sourcemap options provided by fast-sourcemap-concat, which is used
10
+ * by broccoli-concat to build sourcemaps. This is *not* an exhaustive
11
+ * list, so a catch-all is provided for undocumented props if needed.
12
+ */
13
+ export interface BroccoliConcatSourcemapOptions {
14
+ enabled ?: boolean ;
15
+ extensions ?: string [ ] ;
16
+ inline ?: boolean ;
17
+ mapCommentType ?: "block" | "line" ;
18
+ [ propName : string ] : unknown ;
19
+ }
20
+
21
+ /**
22
+ * Options provided by broccoli-concat, which the ember-app plugin uses
23
+ * to combine CSS files together during the post-process step. You can
24
+ * use these options to control the order in which files are concatenated,
25
+ * or other options related to concatenation.
26
+ */
27
+ export interface BroccoliConcatOptions {
28
+ outputFile ?: string ;
29
+ header ?: string ;
30
+ headerFiles ?: string [ ] ;
31
+ /**
32
+ * The files to contatenate together during the postprocess step. Do keep
33
+ * in mind this you'll have access only to the files in the CSS postprocess
34
+ * tree for ember-app. You can use globs if preferred.
35
+ *
36
+ * Any top-level files that are processed by Ember CLI will likely be stored
37
+ * at "styles/<name-of-file>.css". You can use a plugin such as broccoli-debug
38
+ * to determine the structure of your styles after processing.
39
+ *
40
+ * Your CSS Blocks file will be available by default
41
+ * at "styles/css-blocks.css", but will vary if the "output" property is set
42
+ * in your CSS Blocks options.
43
+ */
44
+ inputFiles ?: string [ ] ;
45
+ footerFiles ?: string [ ] ;
46
+ footer ?: string ;
47
+ sourceMapConfig ?: BroccoliConcatSourcemapOptions ;
48
+ allowNone ?: boolean ;
49
+ }
50
+
8
51
export interface CSSBlocksEmberOptions {
9
52
output ?: string ;
10
53
aliases ?: ObjectDictionary < string > ;
11
54
analysisOpts ?: AnalysisOptions ;
12
55
parserOpts ?: Writeable < ParserOptions > ;
13
56
optimization ?: Partial < OptiCSSOptions > ;
57
+ /**
58
+ * Options that control the behavior of broccoli-concat, which is used
59
+ * to concatenate CSS files together by ember-app during postprocess.
60
+ * If this is set to "SKIP", broccoli-concat will *not* run.
61
+ * You'll need to add additional processing to add the CSS Blocks
62
+ * compiled content to your final CSS build artifact.
63
+ */
64
+ broccoliConcat ?: BroccoliConcatOptions | "SKIP" ;
14
65
}
15
66
16
67
export interface ResolvedCSSBlocksEmberOptions {
@@ -19,12 +70,14 @@ export interface ResolvedCSSBlocksEmberOptions {
19
70
analysisOpts : AnalysisOptions ;
20
71
parserOpts : ParserOptions ;
21
72
optimization : Partial < OptiCSSOptions > ;
73
+ broccoliConcat : BroccoliConcatOptions | "SKIP" ;
22
74
}
23
75
24
76
export function getConfig ( root : string , isProduction : boolean , options : CSSBlocksEmberOptions ) : ResolvedCSSBlocksEmberOptions {
25
77
if ( ! options . aliases ) options . aliases = { } ;
26
78
if ( ! options . analysisOpts ) options . analysisOpts = { } ;
27
79
if ( ! options . optimization ) options . optimization = { } ;
80
+ if ( ! options . broccoliConcat ) options . broccoliConcat = { } ;
28
81
29
82
if ( ! options . parserOpts ) {
30
83
options . parserOpts = config . searchSync ( root ) || { } ;
0 commit comments