-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with Webpack #52
Comments
I haven't used Webpack before! Did you consider https://github.com/postcss/postcss-loader ? @ai Your input is highly appreciated! |
OK. For example, you have two bundles: Then, import @import "../main.css"; And process module.exports = {
module: {
loaders: [
{
test: /\.rtl\.css$/,
loader: "style-loader!css-loader!postcss-loader?pack=rtl"
},
{
test: /\.css$/,
loader: "style-loader!css-loader!postcss-loader"
}
]
},
postcss: function () {
return {
defaults: [autoprefixer, precss],
rtl: [rtlcss, autoprefixer, precss]
};
}
} |
But I am not really webpack user (for now, I prefer Browserify, because webpack API is ugly). So I can only show you a start point. |
Thanks @ai |
Thanks. I get the idea except I feel that importing main.css within main.rtl is a bit redundant and I guess it is a work around webpack that will only generate one file per entry. I will try to play with this a little bit and see how it goes and report back here. thanks again both. |
Closing this as it's out of scope, but feel free to post here if you figure out a solution. |
I have the exact same question actually but the answer of creating another rtl file is a bit weird actually. By using the extract-text-webpack-plugin, we should be able to generate the main.ltr.css file and the main.rtl.css file without even duplicating anything. I will digg into it |
Cool ... Thanks! |
Hi, I've started a webpack plugin to produce a second bundle processed with rtlcss: https://github.com/romainberger/webpack-rtl-plugin (available on npm). It's meant to be used with the extract-text-webpack-plugin. Hope this helps you, feedback appreciated! |
Awesome 👍 |
Small update if people are still interested, I've made a rtl-css-loader for webpack to replace the basic |
Hello, anything new related to rtlcss usage with webpack? |
It's not an issue but rather a question on how to use it with Webpack and postcss. My scenario is to produce two different packages one with RTL and the other is with LTR and to request one of them based on interface switching.
Any idea would be highly appreciated!
The text was updated successfully, but these errors were encountered: