File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,41 @@ type Filter = string | RegExp
8
8
type Implementation = typeof import ( 'lightningcss' )
9
9
type TransformOptions = InternalTransformOptions < CustomAtRules >
10
10
11
+ // feature options
12
+ type TransformFeature = Pick < TransformOptions , 'include' | 'exclude' >
13
+ interface IFeatureOptions {
14
+ features ?: TransformFeature
15
+ }
16
+
11
17
// minify plugin
12
- type AllowTransformOpts = Omit <
18
+ type AllowMinifyOpts = Omit <
13
19
TransformOptions ,
14
- 'filename' | 'code' | 'minify' | 'cssModules' | 'targets'
20
+ | 'filename'
21
+ | 'code'
22
+ | 'minify'
23
+ | 'cssModules'
24
+ | 'targets'
25
+ | 'inputSourceMap'
26
+ | 'include'
27
+ | 'exclude'
28
+
15
29
/**
16
- * allow
30
+ * support
17
31
*
18
32
* @sourceMap
19
- * @targets
33
+ * @projectRoot
20
34
* @drafts
35
+ * @nonStandard
21
36
* @analyzeDependencies
22
37
* @pseudoClasses
23
38
* @unusedSymbols
24
39
* @errorRecovery
40
+ * @visitor
41
+ * @customAtRules
25
42
*/
26
43
>
27
44
28
- export interface IMinifyPluginOpts extends AllowTransformOpts {
45
+ export interface IMinifyPluginOpts extends AllowMinifyOpts , IFeatureOptions {
29
46
include ?: Filter | Filter [ ]
30
47
exclude ?: Filter | Filter [ ]
31
48
targets ?: string | string [ ]
@@ -37,17 +54,22 @@ export interface IMinifyPluginOpts extends AllowTransformOpts {
37
54
type AllowLoaderTransformOpts = Omit <
38
55
TransformOptions ,
39
56
'filename' | 'code' | 'targets' | 'inputSourceMap'
57
+
40
58
/**
41
- * allow
59
+ * support
42
60
*
43
61
* @cssModules
44
62
* @minify
45
63
* @sourceMap
64
+ * @projectRoot
46
65
* @drafts
66
+ * @nonStandard
47
67
* @analyzeDependencies
48
68
* @pseudoClasses
49
69
* @unusedSymbols
50
70
* @errorRecovery
71
+ * @visitor
72
+ * @customAtRules
51
73
*/
52
74
>
53
75
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ export class LightningCssMinifyPlugin {
90
90
exclude,
91
91
test : testRegExp ,
92
92
targets : userTargets ,
93
+ features : transformFeatureOptions ,
93
94
...transformOptions
94
95
} = this . options
95
96
@@ -118,6 +119,7 @@ export class LightningCssMinifyPlugin {
118
119
minify : true ,
119
120
sourceMap : sourcemap ,
120
121
targets,
122
+ ...transformFeatureOptions ,
121
123
...transformOptions ,
122
124
} )
123
125
const codeString = result . code . toString ( )
You can’t perform that action at this time.
0 commit comments