Comments (13)
@datajohnny thanks for helping me sort through this issue. I'm glad you're able to use Tailwind now. I've just merged in all the changes and published v3.6.0 so you don't have to use the git branch version I specified above. Cheers.
from ember-cli-postcss.
Hi @datajohnny, currently you can use the function syntax with plugins defined in the filter
step as it uses broccoli-postcss
. The compile
step uses broccoli-postcss-single
.
Does this work for your use case?
from ember-cli-postcss.
Hi @jeffjewiss, I dont think it does I was trying to implement this new postcss framework called tailwind and without the compile it doesnt parse it. Here is my options hash:
postcssOptions: {
compile: {
enabled: false, // defaults to true
browsers: ['last 3 versions'], // this will override config found in config/targets.js
plugins: []
},
filter: {
enabled: true, // defaults to false
browsers: ['last 3 versions'], // this will override config found in config/targets.js
include: ['styles/app.css'],
exclude: [],
plugins: [
require('tailwindcss')('./tailwind.js')
]
}
}
from ember-cli-postcss.
Thanks for the additional info.
What error output are you getting when trying to build your app? Is it that it can't find the config file?
If so, I think the issue here is that filter runs as a postprocess step. Your app files will be copied to tmp
folders by broccolli, meaning your tailwind.js
file won't live at that location anymore.
Does it work with the default config, if you do require('tailwindcss')()
?
Does it work with the default config (empty options), but using the compile
step?
from ember-cli-postcss.
When I use these options:
postcssOptions: {
compile: {
plugins: [
{ module: require('postcss-cssnext') },
{ module: require('tailwindcss')('./tailwind.js') }
]
},
}
I get this errror:
TypeError: plugin.module is not a function
If I just use the cssnext one it works fine
from ember-cli-postcss.
Does it work if you just do?
postcssOptions: {
compile: {
plugins: [
{ module: require('postcss-cssnext') },
{ module: require('tailwindcss') }
]
},
}
from ember-cli-postcss.
tailwind requires the path as a curry func
from ember-cli-postcss.
I took a look at the source for tailwind, and you can see here:
const lazyConfig = () => {
if (_.isUndefined(config)) {
return require('../defaultConfig')
}
that if no config is provided it uses the default. My suspicion is that the issue is related to trying to require your config, so I was hoping you could verify this by trying to use the default config.
from ember-cli-postcss.
@jeffjewiss I tested how u mentioned and I get the following error:
TypeError: Path must be a string. Received { from: '/Users/johnny/Projects/testy/tmp/postcss_compiler-input_base_path-Zu7KrRVh.tmp//app/styles/app.css',
to: '/Users/johnny/Projects/testy/tmp/postcss_compiler-output_path-3MPqAasb.tmp//assets/testy.css',
map: {},
browsers:
[ 'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions' ] }
at assertPath (path.js:28:11)
at Object.resolve (path.js:1186:7)
from ember-cli-postcss.
Okay thanks for trying that, I'll need to investigate this further. Cheers.
from ember-cli-postcss.
thanks for the help
from ember-cli-postcss.
Okay, so I have a demo Ember app using Tailwind here: https://github.com/jeffjewiss/ember-tailwind-example
The gist of it is that you'll need to change your package.json
to have:
"ember-cli-postcss": "jeffjewiss/ember-cli-postcss#support-plugin-function",
and then you can do:
postcssOptions: {
compile: {
enabled: true,
plugins: [
require('tailwindcss')('./app/styles/tailwind.js'),
]
}
}
The options for Tailwind behave a bit differently than most Postcss plugins, so I left a proposal about potentially updating them.
Otherwise, I'll be able to make changes to broccoli-postcss-single
and release a new version of ember-cli-postcss
with this change. I'd like to wait and see if Tailwind will update, but in the meantime you should be able to use the above settings for your app.
from ember-cli-postcss.
yeah that did it for me, thank you soo much for your help
from ember-cli-postcss.
Related Issues (20)
- Embroider and postcss-import can't find file in node_modules? HOT 1
- Does not work with postcss 8 HOT 4
- apps, addons, and tailwind specificity HOT 3
- Infinite loop with postcss-color-hex-alpha HOT 2
- Embroider compatibility issue (filter) HOT 2
- Cannot use SCSS in version 7 HOT 10
- How do you run css compilation when templates are updated? HOT 23
- Ember canary error - Uncaught ReferenceError: Ember is not defined HOT 3
- Vulnerability in merge package before 2.1.1 HOT 1
- Deprecation warnings with Ember 3.27 HOT 14
- Addon using @tailwindcss/jit: ENOENT: no such file or directory, stat 'assets/vendor.css' HOT 1
- `yarn outdated` is Confusing HOT 2
- Cannot use `cssnano` in version 7 HOT 6
- ember-cli-postcss v7.1.0 has a breaking change as it's requires Node.js 14 now HOT 5
- ChainAlert: npm package release (7.2.0) has no matching tag in this repo
- Node 12 dropped too early? HOT 1
- Filter deprecation warnings HOT 1
- How do I add postcss-nested to configuration? HOT 1
- [Bug]: Conflicting with ember-cli-sass HOT 2
- how to apply a specific postcss plugin to only a specific set of files
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-cli-postcss.