@@ -3,6 +3,7 @@ import type { EyeglassOptions, default as Eyeglass } from "eyeglass"; // works,
33import type { Result , SassError } from "node-sass" ;
44import type SassImplementation from "node-sass" ;
55import { sep as PATH_SEPARATOR } from "path" ;
6+ import cloneDeep = require( "lodash.clonedeep" ) ;
67
78export type Adaptor = ( sass : typeof SassImplementation , eyeglass : typeof Eyeglass , options : EyeglassOptions ) => Preprocessor ;
89export type AdaptorSync = ( sass : typeof SassImplementation , eyeglass : typeof Eyeglass , options : EyeglassOptions ) => PreprocessorSync ;
@@ -123,7 +124,10 @@ export class DirectoryScopedPreprocessor implements PreprocessorProvider {
123124 */
124125 init ( sass : typeof SassImplementation , eyeglass : typeof Eyeglass , options : EyeglassOptions = { } ) {
125126 let sassOptions = this . setupOptions ( options ) ;
126- let sassOptionsSync = this . setupOptionsSync ? this . setupOptionsSync ( sassOptions ) : sassOptions ;
127+
128+ let sassOptionsSync = cloneDeep ( sassOptions ) ;
129+ sassOptionsSync = this . setupOptionsSync ? this . setupOptionsSync ( sassOptionsSync ) : sassOptionsSync ;
130+
127131 this . scssProcessor = adaptor ( sass , eyeglass , sassOptions ) ;
128132 this . scssProcessorSync = adaptorSync ( sass , eyeglass , sassOptionsSync ) ;
129133 }
@@ -146,7 +150,7 @@ export class DirectoryScopedPreprocessor implements PreprocessorProvider {
146150 * provided from the application that will be used for compiling this
147151 * package's block files synchronously.
148152 *
149- * The options passed into this function are those returned by
153+ * The options passed into this function are a copy of those returned by
150154 * setupOptions(), so this method only needs to update those options as
151155 * appropriate to support synchronous compilation.
152156 *
0 commit comments