@@ -31,8 +31,8 @@ test('vue rule with include', async () => {
31
31
const result = await mockBundleAndRun ( {
32
32
entry : 'basic.vue' ,
33
33
modify : ( config : any ) => {
34
- const i = config . module . rules . findIndex ( ( r ) =>
35
- r . test . toString ( ) . includes ( 'vue' )
34
+ const i = ( config . module . rules as webpack . RuleSetRule [ ] ) . findIndex ( ( r ) =>
35
+ r . test ? .toString ( ) . includes ( 'vue' )
36
36
)
37
37
config . module . rules [ i ] = {
38
38
test : / \. v u e $ / ,
@@ -74,10 +74,10 @@ test('normalize multiple use + options', async () => {
74
74
await bundle ( {
75
75
entry : 'basic.vue' ,
76
76
modify : ( config : any ) => {
77
- const i = config . module . rules . findIndex ( ( r ) =>
78
- r . test . toString ( ) . includes ( 'vue' )
77
+ const i = ( config . module . rules as webpack . RuleSetRule [ ] ) . findIndex ( ( r ) =>
78
+ r . test ? .toString ( ) . includes ( 'vue' )
79
79
)
80
- config ! . module ! . rules [ i ] = {
80
+ config . module . rules [ i ] = {
81
81
test : / \. v u e $ / ,
82
82
use : [
83
83
{
@@ -91,11 +91,11 @@ test('normalize multiple use + options', async () => {
91
91
} )
92
92
93
93
test ( 'should not duplicate css modules value imports' , async ( ) => {
94
- const { window, exports } = await mockBundleAndRun ( {
94
+ const { window, _exports } = await mockBundleAndRun ( {
95
95
entry : './test/fixtures/duplicate-cssm.js' ,
96
96
modify : ( config : any ) => {
97
- const i = config . module . rules . findIndex ( ( r ) =>
98
- r . test . toString ( ) . includes ( 'css' )
97
+ const i = ( config . module . rules as webpack . RuleSetRule [ ] ) . findIndex ( ( r ) =>
98
+ r . test ? .toString ( ) . includes ( 'css' )
99
99
)
100
100
config . module . rules [ i ] = {
101
101
test : / \. c s s $ / ,
@@ -117,8 +117,8 @@ test('should not duplicate css modules value imports', async () => {
117
117
const style = normalizeNewline ( styles [ 1 ] ! . textContent ! )
118
118
// value should be injected
119
119
expect ( style ) . toMatch ( 'color: red;' )
120
- // exports is set as the locals imported from values.css
121
- expect ( exports . color ) . toBe ( 'red' )
120
+ // _exports is set as the locals imported from values.css
121
+ expect ( _exports . color ) . toBe ( 'red' )
122
122
} )
123
123
124
124
// #1213
@@ -146,8 +146,8 @@ test('usage with null-loader', async () => {
146
146
await mockBundleAndRun ( {
147
147
entry : 'basic.vue' ,
148
148
modify : ( config : any ) => {
149
- const i = config . module . rules . findIndex ( ( r ) =>
150
- r . test . toString ( ) . includes ( 'css' )
149
+ const i = ( config . module . rules as webpack . RuleSetRule [ ] ) . findIndex ( ( r ) =>
150
+ r . test ? .toString ( ) . includes ( 'css' )
151
151
)
152
152
config . module . rules [ i ] = {
153
153
test : / \. c s s $ / ,
0 commit comments