File tree 3 files changed +15
-1
lines changed
plugins/postcss-env-function
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ module.exports = {
61
61
expect : 'basic.import.expect.css' ,
62
62
result : 'basic.import.result.css'
63
63
} ,
64
+ 'basic:import-cjs' : {
65
+ message : 'supports { importFrom: "test/import-variables.cjs" } usage' ,
66
+ options : {
67
+ importFrom : 'test/import-variables.cjs'
68
+ } ,
69
+ expect : 'basic.import.expect.css' ,
70
+ result : 'basic.import.result.css'
71
+ } ,
64
72
'basic:import-js-from' : {
65
73
message : 'supports { importFrom: { from: "test/import-variables.js" } } usage' ,
66
74
options : {
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export default function importEnvironmentVariablesFromSources(sources) {
73
73
} ) . reduce ( async ( environmentVariables , source ) => {
74
74
const { type, from } = await source ;
75
75
76
- if ( type === 'js' ) {
76
+ if ( type === 'js' || type === 'cjs' ) {
77
77
return Object . assign ( environmentVariables , await importEnvironmentVariablesFromJSFile ( from ) ) ;
78
78
}
79
79
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ environmentVariables : {
3
+ '--some-custom-padding' : '20px' ,
4
+ '--another-custom-width' : '600px'
5
+ }
6
+ } ;
You can’t perform that action at this time.
0 commit comments