File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " typescript-plugin-css-modules" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"main" : " lib/index.js" ,
5
5
"author" :
" Brody McKee <[email protected] >" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -31,10 +31,28 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
31
31
const options : Options = info . config . options || { } ;
32
32
logger . log ( `options: ${ JSON . stringify ( options ) } ` ) ;
33
33
34
- // Set environment variables, resolves #49 .
34
+ // Load environment variables like SASS_PATH .
35
35
// TODO: Add tests for this option.
36
+ const dotenvOptions = options . dotenvOptions || { } ;
37
+ if ( dotenvOptions ) {
38
+ dotenvOptions . path = path . resolve (
39
+ directory ,
40
+ dotenvOptions . path || '.env' ,
41
+ ) ;
42
+ }
36
43
dotenv . config ( options . dotenvOptions ) ;
37
44
45
+ // Normalise SASS_PATH array to absolute paths.
46
+ if ( process . env . SASS_PATH ) {
47
+ process . env . SASS_PATH = process . env . SASS_PATH . split ( path . delimiter )
48
+ . map ( ( sassPath ) =>
49
+ path . isAbsolute ( sassPath )
50
+ ? sassPath
51
+ : path . resolve ( directory , sassPath ) ,
52
+ )
53
+ . join ( path . delimiter ) ;
54
+ }
55
+
38
56
// Add postCSS config if enabled.
39
57
const postCssOptions = options . postCssOptions || { } ;
40
58
You can’t perform that action at this time.
0 commit comments