Comments (9)
i guess this can be closed then.
from less-plugin-glob.
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.
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.
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.
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.
+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.
totally agree :)
from less-plugin-glob.
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.
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)
- Here is non-less file issue HOT 1
- Installing with Grunt HOT 1
- Absolute paths are broken. HOT 2
- Advanced glob patterns not working HOT 1
- Unable to load plugin HOT 3
- Add an NPM publish automation via Travis HOT 1
- Request custom `processPaths()` callback
- Imported modules are not watched by Webpack 4 (i.e. Hot Reload does not work) HOT 1
- Import order is not deterministic HOT 1
- make compatible with grunt-contrib-less HOT 1
- Globbing Not Functioning HOT 7
- Add configuration option to change the way file paths are generated HOT 13
- Unable to make it work HOT 3
- Upgrading from 1.0.0 to 1.0.1 caused an issue HOT 1
- Usage in webpack? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from less-plugin-glob.