Standard-minifiers and .less includes


#1

Hi,

switched to meteor v1.2 and now my less includes doesn’t work.

Old code was:

@include "../framework/bootstrap3/custom.bootstrap.less"

(included file is located in /client/styles/framework/bootstrap3/custom.bootstrap.less, and file that includes it is located in /client/styles/styles/styles.less)

Now, what is correct path to include this file? Path is now relative to what?

Thanks!
Petar


#2

have you read this


#3

To answer my own question: path is good, but I included .less instead .import.less.


#4

And error was:

   While processing files with less (for target web.browser):
   client/styles/styles/styles.less:1: Unknown import:
   ../framework/bootstrap3/custom.bootstrap.less

#5

Having the same issue. Read the breaking changes doc but its confusing. Where you able to find a fix for this.


#6

Also, I don’t think less support a @include keyword. I might be wrong but I’m having the same issue on @import.


#7

It’s @import in my code, but I made typo while writing this post.


#8

@emmanuelbuah see my previous post - problem was importing .less file instead .import.less - it looks like it’s not supported anymore.

However, I still got problems with css - no more errors, but when I @import theme, it doesn’t work properly (looks like order of files - like theme is included before default bootstrap in resulting css).

:frowning:


#9

Its a bug or by design. It looks like @import with a path other than the current location of the executing file throws an exception.


#10

Just to add one more thing in case someone have the same problem:

You can @import any file by specifying path relative to application root by using empty curly braces:

@import "{}/client/styles/framework/bootstrap3/custom.bootstrap.less"

(source: https://atmospherejs.com/meteor/less )

And… that’s final solution for my problem.


#11

does anyone have imports from a dot folder in the root? I have several assets in a “.build” folder in the root to have it ignored for autocompiling. with meteor 1.2 I can not include those anymore - used to work though.

neither of those seem to accomplish that:

import "/.build/styles.less"
import "{}/.build/styles.less"

as soon as I rename .build to build it works, but that would cause alle the sources in there to be compiled, no?