Comments (10)
@ynnoj You shouldn't have any need for ember-cli-postcss
with this—you can pass PostCSS plugins directly to this addon to be executed as part of the modules pipeline. Is there something specific you're looking to do with ember-cli-postcss
that you can't accomplish that way?
from ember-css-modules.
@dfreeman Awesome! I did not realise that. I'll adjust the project build setup and see how it works out.
Thanks!
from ember-css-modules.
The fact that app.less
gets lost definitely looks like a bug on this end. Assuming that's something simple (and I suspect it is), you should be able to get ember-css-modules
and ember-cli-less
working pretty smoothly in isolation from one another once that's fixed.
Actually using the two in concert is going to be a harder problem (partially discussed in #4). In particular with Less, the @value foo: bar;
syntax conflicts with Less's @foo: bar;
variables, which will likely limit what's possible.
Regardless, losing the .less
file is something we should be able to fix—I'll see if I can track that down before the next release goes out.
from ember-css-modules.
I'm encountering the same issue, but when using ember-cli-postcss
.
from ember-css-modules.
I haven't really gotten to the bottom of this yet, but it looks like the toTree
function within ember-cli-less never gets called when ember-css-modules is added to the problem.
I'll report back if I can figure out why...
from ember-css-modules.
I found the issue, PR incoming soon.
https://github.com/salsify/ember-css-modules/blob/master/lib/output-styles-preprocessor.js#L25
Should be a merge tree consisting of inputNode and the returned tree from this.dynamicHeaderConcat(concatOptions)
. But not returning it, it seems to break other plugins registered on the css registry.
I'll patch this because in our example, we are using postcss along side, and ordered in front of ember-css-modules, to do a lot of other preprocessing steps. Like @dfreeman this won't make this addon work with something like ember-cli-less
but will likely cause it to fail parsing a less file versus the less file not even making it to the parser.
from ember-css-modules.
@jasonmit thanks for investigating — I got as far as the dropped inputNode
, but came to the same conclusion around it still being difficult to get multiple CSS preprocessors to live nicely together.
I have a couple other ideas I'll try playing with when I next have some time to devote to squashing bugs here.
from ember-css-modules.
Yeah, the thing about merging the tree I found that it will write the original styles tree, in it's entirety, to the dist (not just the concatted app.css). This required then to do some postProcessTree filtering to make sure that folder structure gets filtered out.
The core of the issue is that ember-cli doesn't support really two preprocessors on the same tree-type without hacks in place, such as:
https://github.com/jasonmit/______ember-css-example/blob/master/lib/postcss-addon/index.js#L13-L21
Have you explored moving this logic to a treeForStyles
hook instead of registering a preprocessor for the type js
this way other addons might be able to mutate that tree before ember-css-modules does. The challenge I guess is figuring out how to write to the app tree within the treeForStyles
hook.
This is really impressive work, great addon.
from ember-css-modules.
@jasonmit The story of this addon is mostly one of plumbing trees between places that Ember CLI doesn't really expect them to go 😉 .
@antulik I think I've got a reasonable fix on this branch, with a demo app making use of it. It allows you to specify an intermediateOutputPath
for the concatenated modules so that your preprocessor of choice can import that and then do whatever else it wants in order to produce the final output.
That branch still needs documentation and testing, but can you take a look and see if it seems like it'll solve your problem?
from ember-css-modules.
This is now possible in 0.4.0, which was just released — see the README for details.
from ember-css-modules.
Related Issues (20)
- Is there a codemod to colocate CSS modules with their components? HOT 2
- Turn off `Component.reopen()` call
- Deprecation use of Reopening the Ember.Component super class HOT 2
- Why we don't have tests that covers `Ember Engines`
- Incompatible with `postcss-nested` 5+ HOT 2
- Not compatible with Ember 4 HOT 3
- Question: How to use it on Ember Engines HOT 1
- Doesn't work with `ember-cli-sass`
- css file hash doesn't use correct path when generating-scoped-name in embroider app build, when consuming an addon using ecm HOT 1
- Provide exclude glob option HOT 1
- Tree passed to preprocessors for app and addon is not scoped with moduleName
- Replace local-class with class at build time instead of runtime HOT 2
- Question: How to use it with v2 addon? HOT 1
- Documenting migration from global app.css to css-modules
- pod route template: using `local-class` throws error HOT 1
- how to disable shipping JS modules?
- Usage in addons + Embroider build
- Heroku build got stuck in 1.6.2
- vendor files imported via postcss-import not being recompiled on change.
- Support for ember-template-imports? HOT 5
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 ember-css-modules.