Git Product home page Git Product logo

Comments (9)

philipp-serfling avatar philipp-serfling commented on September 25, 2024 1

i guess this can be closed then.

from less-plugin-glob.

just-boris avatar just-boris commented on September 25, 2024

Hello. I created a test project with the following directory structure

src/
├── a
│   └── b
│       └── tablet.less
└── index.less

where index.less has the following import

@import "**/tablet";

And it is being resolved properly.
I have used less-cli directly, without build tools. If you have different use-case, let me know.

from less-plugin-glob.

philipp-serfling avatar philipp-serfling commented on September 25, 2024

index.less with following import fails

@import "**/*.less"
src/
├── a
│   └── foo.less
├── bar.less
└── index.less

I am using the plugin with Grunt. package.json looks like this

 "grunt-contrib-less": "1.4.0",
"less-plugin-glob": "2.0.0",
...

The Error Message is

Running "less:dist" (less) task
>> ParseError: Unrecognised input in /home/.../node_modules/less/test/less-bom/errors/bad-variable-declaration1.less on line 1, column 1:
>> 1 @@demo: "hi";

from less-plugin-glob.

just-boris avatar just-boris commented on September 25, 2024

Hello @Looser,

Your wildcard seems very broad. It literally includes all files from your project, including node_modules folder. Try to adjust the glob expression to something more specific, like ./**/*.js.

from less-plugin-glob.

philipp-serfling avatar philipp-serfling commented on September 25, 2024

Oh i am sorry, maybe src was not the best word for that folder.
Imagine that under src ther are only *.less files and folders containing *.less files.
The node_modules folder is on a different path.

But @import "./**/*.less" is also throwing an ParseError. It seems like that the import expression must not start with a glob expression.
Working:
@import "bar.less"
@import "a/foo.less"
@import "a/*.less"
@import "../src/**/*.less"

Not working:
@import "*.less"
@import "./*.less"
@import "./**/*.less"
@import "**/*.less"

from less-plugin-glob.

julie75p avatar julie75p commented on September 25, 2024

+1 thx @Looser for the tip of @import "../app/**/*.less" instead of @import "**/*.less" which are equal for me.

It seems that if the plugin sees ** first in the string, it bugs. Put a ../app/ in front of it works, but damn it's ugly :P

from less-plugin-glob.

philipp-serfling avatar philipp-serfling commented on September 25, 2024

totally agree :)

from less-plugin-glob.

just-boris avatar just-boris commented on September 25, 2024

Hello! I have dome some experiments, and there is a branch with the fix: paths-selection.

It does smart logic and tries to match paths one-by-one in order to understand what import did you mean. Even though all tests are passing, it will be a breaking change, because the behavior is actually changed.

Also you can help me with releasing this if you will install feature-branch instead of stable release, and check whether it works. You can install feature branch doing:

npm install github:just-boris/less-plugin-glob#paths-selection

from less-plugin-glob.

philipp-serfling avatar philipp-serfling commented on September 25, 2024

This looks all very promising

Now working:
@import "*.less"
@import "./*.less"
@import "./**/*.less"
@import "**/*.less"

Not working:
-

thank you!

from less-plugin-glob.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.