-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: allow passing path to sass config file #1
Comments
I modified the source of plugin but there's an error I can't debug (probably somewhere inside node-sass binding) My version of const configs = new Map();
function extractVariables(absolutePath, compiledFiles, options) {
let vars;
if(compiledFiles[absolutePath]) {
vars = compiledFiles[absolutePath];
} else {
if ('sassConfigPath' in options && !configs.has(options.sassConfigPath)) {
configs.set(options.sassConfigPath, require(path.resolve(options.sassConfigPath)));
}
const loadedOptions = configs.get(options.sassConfigPath);
vars = compiledFiles[absolutePath] = sassExtract.renderSync(Object.assign({}, options, loadedOptions, {file: absolutePath})).vars;
}
return vars;
} {
"plugins": [
["babel-plugin-sass-extract", {
"sassConfigPath": "./sass.conf.js"
}],
]
} I went down to var rendered = _nodeSass2.default.renderSync(compileOptions); Wrapping it in try-catch doesn't help. |
@jrencz thank you for your contributions. I am currently looking into handling additional custom importers and passing functions through the plugins. The custom importers will initially need some more work in the sass-extract core library. Regarding the function passing issue I might add an alternative configuration method by having a |
dedicated file seems reasonable Going from there to expressing the path in plugin config via .babelrc is not far away |
First thing: thank you for following my suggestion and starting this project!
My use case:
As I mentioned described in jgranstrom/sass-extract-loader#2 I have custom importers and functions in sass and it's not possible to use this babel plugin without them because of sass errors.
Since babel doesn't allow
babelrc.js
(babel/babel/issues/4630) and node sass has no option to pass path to options instead of actual options the only way I see is to add options loader in the pluginThe text was updated successfully, but these errors were encountered: