This project has moved and is read-only. For the latest updates, please go here.

Is string interpolation not supported?

Feb 13, 2014 at 10:04 AM
Edited Feb 13, 2014 at 10:07 AM
This fails using the latest version 1.8.21:

@PLUGINS_DIR: "plugins";
@BOOTSTRAP_DIR: "@{PLUGINS_DIR}/bootstrap";

@import "@{BOOTSTRAP_DIR}/variables.less"; // fail
@import @{BOOTSTRAP_DIR}"/variables.less"; // fail as well

Edit, here is the server error:
File '/assets/css/@{BOOTSTRAP_DIR}/variables.less' not exist.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: File '/assets/css/@{BOOTSTRAP_DIR}/variables.less' not exist.

Source Error:


Line 3: }
Line 4: @section styles {
Line 5: @Styles.Render("~/styles/site") Line 6: }
Feb 13, 2014 at 10:22 AM
Hello, Erik!

In BundleTransformer.Less cannot use the string interpolation in file paths.

Use in the file paths only constants. This is limitations of the Bundle Transformer`s architecture.
Feb 13, 2014 at 10:29 AM
Alright, thanks for the info, we can live without that part anyways.
Nov 12, 2015 at 11:55 AM
Hello, Erik!

Now BundleTransformer.SassAndScss (see the Bundle Transformer 1.9.81 release notes) supports the string interpolation in file paths.
Nov 12, 2015 at 1:17 PM
Thanks for the update!

/Erik


Feb 17, 2016 at 3:18 PM
I'm confused. The original post refers to BundleTransformer.Less, but the update refers to BundleTransformer.SassAndScss. Does that mean it's still broken in BundleTransformer.Less? I updated to the latest BundleTransformer.Core and BundleTransformer.Less, and it's still not working. I just want to make sure I'm not doing something wrong.
Feb 23, 2016 at 10:32 AM
Edited Mar 9, 2016 at 11:33 AM
Hello, ak47oh!

This problem is solved in the BundleTransformer.Less 1.9.92 and later versions.
Marked as answer by Taritsyn on 3/9/2016 at 3:33 AM