Comments (13)
I am using this with webpack and it works fine for me. Could you please provide more information about your webpack setup?
from less-plugin-glob.
You can check my current setup here https://github.com/Auxx/angular2-ts-boilerplate/tree/glob (angular2-ts-boilerplate project, branch "glob").
from less-plugin-glob.
Well, there is nothing to do on our side, it is only issues with Webpack integration. In your example you should add option root=true
for less-loader:
-{'test': /\.less$/, 'loader': extractTextPlugin.extract('style', 'css!less')},
+{'test': /\.less$/, 'loader': extractTextPlugin.extract('style', 'css!less?root=true')},
Otherwise every import will be prefixed with ./
and your import will be broken.
Also you should add more asterisks to glob expression to look for files in component folders
-@import "../app/**";
+@import "../app/**/**";
from less-plugin-glob.
Well, that didn't help at all, sadly. I'm still getting the same error.
from less-plugin-glob.
The same setup works for me. Let's check the dependencies. I have:
├── [email protected]
├─┬ [email protected]
├─┬ [email protected]
I cleaned up the node_modules
folder, then npm install && gulp build
from less-plugin-glob.
OK, I think I know what is the root of the problem. I'm using Windows and path separator is "" on Windows and it should be escaped or changed to "/". Generated imports look this way right now:
@import "C:\dev-x\angular2-ts-boilerplate\src\app\app.component.less";
@import "C:\dev-x\angular2-ts-boilerplate\src\app\hello\hello.component.less";
from less-plugin-glob.
That makes sense.
I'll find a windows image and will check it again.
from less-plugin-glob.
I might make a fix for that this evening after work.
from less-plugin-glob.
After some investigation I've found out that the issue is in LESS compiler - unless the string starts with a slash, it is always prepended with "./". I did not manage to find the offending piece of code yet, but it looks like your plugin is OK. Issue can be closed now, but I will continue my journey...
from less-plugin-glob.
Ok, I will be considering the issue as on hold. If you file related issue somewhere else, link it here, I'd like to track.
from less-plugin-glob.
A bug was found in webpack/loader-utils after many hours of debugging :) An issue with a bug description and a link to pull request with a fix is here.
@hannabasha check it out. If you need this fix before it goes to the main line if loader-utils, you can replace the library with my version inside your node_modules. Make sure to to update everything properly once the library is updated officially.
from less-plugin-glob.
@Auxx thank you! I will close my opened issue then!
from less-plugin-glob.
Hi, I have the same problem in my webpack setup even though I'm on OS X and have added the root=true
to the less configuration. I have a sample repository here with the less-glob
tag pointing to the problematic setup https://github.com/bostrom/webpack-demo/tree/less-glob.
Any ideas on this one?
from less-plugin-glob.
Related Issues (16)
- Globbing Pattern seems wrong HOT 9
- 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
- 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.