gabrielgrant / broccoli-less-single Goto Github PK
View Code? Open in Web Editor NEWBroccoli plugin for compiling .less files with n-to-one semantics
License: MIT License
Broccoli plugin for compiling .less files with n-to-one semantics
License: MIT License
i'm using ember-cli 0.1.5,
I'd like to build a css file for each 'skin-*.less' file in the app/styles folder. This works with plain CSS using the following config in my Brocfile.js:
var app = new EmberApp({
outputPaths: {
app: {
css: {
'skin-light': '/assets/skin-light.css',
'skin-dark': '/assets/skin-dark.css'
}
}
}
});
After installing the LESS precompiler with 'ember install:addon ember-cli-less' this config is not respected and instead 'ember build' looks for app/styles/app.less.
Seems like we can avoid by releasing a version that limits to v2.6 of Less?
Hi there, thank you for creating broccoli-less-single. Unfortunately, it fails with an error if you use it with broccoli 0.7.2, while it works fine with 0.5.x (didn't check 0.6.x, sorry):
Object #<TreeMerger> has no method 'reduce' TypeError: Object #<TreeMerger> has no method 'reduce'
at promiseMapSeries (/path/to/project/node_modules/broccoli-less-single/node_modules/promise-map-series/index.js:6:16)
at LessCompiler.read (/path/to/project/node_modules/broccoli-less-single/index.js:25:10)
at readTree (/path/to/project/node_modules/broccoli/lib/builder.js:61:20)
at promise.then.then.results.(anonymous function) (/path/to/project/node_modules/broccoli-merge-trees/node_modules/promise-map-series/index.js:8:27)
at invokeCallback (/path/to/project/node_modules/broccoli-merge-trees/node_modules/promise-map-series/node_modules/rsvp/dist/commonjs/rsvp/promise.js:228:21)
at publish (/path/to/project/node_modules/broccoli-merge-trees/node_modules/promise-map-series/node_modules/rsvp/dist/commonjs/rsvp/promise.js:176:9)
at publishFulfillment (/path/to/project/node_modules/broccoli-merge-trees/node_modules/promise-map-series/node_modules/rsvp/dist/commonjs/rsvp/promise.js:312:5)
at flush (/path/to/project/node_modules/broccoli-merge-trees/node_modules/promise-map-series/node_modules/rsvp/dist/commonjs/rsvp/asap.js:41:9)
at process._tickCallback (node.js:415:13)
Some upgrade in Travis CI broke the auto npm deployments. This needs to be investigated and fixed.
Less.js supports inline source maps with the options hash { sourceMap: { sourceMapFileInline: true } }
. Unfortunately, the options handler detects the presence of sourceMap
and implicitly and unconditionally fills in sourceMap.sourceMapURL
which during the build step causes the source map to be written to its own file despite Less.js having already generated the inline map.
I've already fixed this in a fork, PR incoming. ๐
Having syntax errors in your less causes ember-cli server to crash. This also happens when you import less files that don't exist yet.
file changed editor.less
file changed styles/editor.less
ParseError: Unrecognised input in .../tmp/tree_merger-tmp_dest_dir-W7qmEPWo
.tmp/app/styles/editor.less on line 19, column 9:
18 height: 100px;
19 background-color #cccccc;
20 }
var css = tree.toCSS(lessOptions);
TypeError: Cannot call method 'toCSS' of undefined
Sourcemap files are no longer being written after the less 2.x upgrade (671a424)
That commit updated to using the new less.render
method which returns an output.css and output.map separately.
http://lesscss.org/usage/#v2-upgrade-guide-programmatic-usage
I'm having difficulty getting this working. I am 99% confident it is my fault, and incomplete understanding of one of the various tools involved.
So this is a request for something that would solve my problem and perhaps many others':
Include a complete working example in the repo or in the README. For optimal ease, have this example use Bootstrap in Less form, as that is probably the most common reason someone would come looking for this plug-in.
Currently, we need to lock less.js to < 2.7.0 because of an bug less/less.js#2896
Once this is resolved, we should unlock the dep.
The opposite of: #35
According to https://github.com/ember-cli/ember-cli/blob/master/PERF_GUIDE.md the broccoli-caching-writer
dependency should be at ^2.2.1
I'm trying to set globalVars in the following manner:
lessOptions: {
globalVars: {
'theme': 'colorful'
}
}
to later do something like this in the app.less:
@import "theme-@{theme}.less";
But the globalVar doesn't seem to be defined, or is lessOptions not allowing globalVars?
See:
http://lesscss.org/features/#variables-feature-urls
http://lesscss.org/usage/#using-less-in-the-browser-relativeurls
yarn audit
output includes the following:
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ high โ Prototype Pollution โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Package โ lodash.merge โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Patched in โ >=4.6.2 โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Dependency of โ [other package] โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Path โ [other packages] > broccoli-less-single > lodash.merge โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ More info โ https://www.npmjs.com/advisories/1066 โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The package.json specifies "lodash.merge": "^3.3.2"
so (assuming the updated version is compatible) a major version bump is required to overcome.
https://github.com/gabrielgrant/broccoli-less-single/blob/master/index.js#L3-L9 dependencies should likely be made lazy/on-demand
Reference: ember-cli/ember-cli#1906
This plugin currently kills any long running services that might call it and throws out errors of mixed quality.
I threw together a quick and dirty solution to both issues here: https://github.com/WMeldon/broccoli-less-single/tree/better-errors
It's currently a fork of the cache fork so I'm not opening a pull request just yet.
Having some simple testing would make it a little easier to quickly merge PRs. Just a couple end-to-end smoke tests would be a good start.
This continues discussion here #31.
As a developer, I expect the less compiler to execute only when I change a less
file in my project. This appears to not be the case. I took the following screenshot of performance output from ember-cli while running ember server
and changing an .hbs
file.
npm ls broccoli-less-single
myproject
โโโฌ [email protected]
โโโ [email protected]
ember-cli: 3.5.0
node: 8.11.4
os: darwin x64
The readme mentions @include
as the way to include other files, but
@include
and not the Less-like @import
@include
and @import
macros are ignored), but there's no examples to refer to on the README.This could all be cleared up with just a quick example .less
file in the README for a quick sanity check.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.