We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We use frontend dependencies as webjars.
There we import resources:
@import "/webjars/bootstrap/4.6.0-1/scss/mixins";
The referenced file contains relative imports (e.g. @import "vendor/rfs";).
@import "vendor/rfs";
This works fine with sass-asset-pipeline, but not with sass-dart-asset-pipeline #287.
The problem can be reproduced even without webjars:
create sass-dart-asset-pipeline/assets/stylesheets/absolute-import/main.scss:
sass-dart-asset-pipeline/assets/stylesheets/absolute-import/main.scss
@import "/bootstrap/bootstrap";
create test in sass-dart-asset-pipeline/src/test/groovy/asset/pipeline/dart/SassProcessorSpec.groovy
sass-dart-asset-pipeline/src/test/groovy/asset/pipeline/dart/SassProcessorSpec.groovy
void "should compile absolute imports"() { given: AssetPipelineConfigHolder.resolvers = [] AssetPipelineConfigHolder.registerResolver(new FileSystemAssetResolver('test','assets')) def assetFile = AssetHelper.fileForFullName('absolute-import/main.scss') def processor = new SassProcessor() when: def output = processor.process(assetFile.inputStream.text,assetFile) then: output.contains('Twitter') }
Then the test fails (the absolute bootstrap.scss is found, but inside the import cannot be resolved):
bootstrap.scss
$ ./gradlew :sass-dart-asset-pipeline:test [...] > Task :sass-dart-asset-pipeline:test asset.pipeline.dart.SassProcessorSpec > should compile absolute imports STANDARD_ERROR [Test worker] ERROR asset.pipeline.dart.SassAssetFileLoader - Unable to find the asset for variables imported by absolute-import//bootstrap/bootstrap asset.pipeline.dart.SassProcessorSpec > should compile absolute imports FAILED com.caoccao.javet.exceptions.JavetExecutionException: Error: Cannot invoke method getByteDigest() on null object ╷ 8 │ @import "variables"; │ ^^^^^^^^^^^ ╵ /bootstrap/bootstrap 8:9 @import stdin 1:9 root stylesheet at com.caoccao.javet.interop.V8Runtime.execute(V8Runtime.java:828) at com.caoccao.javet.interop.executors.V8StringExecutor.execute(V8StringExecutor.java:77) at com.caoccao.javet.interop.IV8Executable.executeVoid(IV8Executable.java:159) at asset.pipeline.dart.SassProcessor.process(SassProcessor.groovy:104) at asset.pipeline.dart.SassProcessorSpec.should compile absolute imports(SassProcessorSpec.groovy:115) 7 tests completed, 1 failed > Task :sass-dart-asset-pipeline:test FAILED
Is this an sass-dart-asset-pipeline implementation issue or can I fix the behaviour within the project configuration?
The text was updated successfully, but these errors were encountered:
Allow to resolve absolute paths in sass-dart-asset-pipeline
da4352e
This enables the same behaviour as in sass-asset-pipeline. Added webjar test cases in bot sass asset-pipelines. fixes bertramdev#297
8f0b4f0
886e67f
Successfully merging a pull request may close this issue.
We use frontend dependencies as webjars.
There we import resources:
The referenced file contains relative imports (e.g.
@import "vendor/rfs";
).This works fine with sass-asset-pipeline, but not with sass-dart-asset-pipeline #287.
The problem can be reproduced even without webjars:
create
sass-dart-asset-pipeline/assets/stylesheets/absolute-import/main.scss
:create test in
sass-dart-asset-pipeline/src/test/groovy/asset/pipeline/dart/SassProcessorSpec.groovy
Then the test fails (the absolute
bootstrap.scss
is found, but inside the import cannot be resolved):Is this an sass-dart-asset-pipeline implementation issue or can I fix the behaviour within the project configuration?
The text was updated successfully, but these errors were encountered: