-
Notifications
You must be signed in to change notification settings - Fork 54
complexRequires (prepend) and specifics options #8
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
Comments
Can you please provide whole Ad 2) I am afraid that I can't resolve your problem with |
My .babelrc: module.exports = {
only: /\.jsx$/,
plugins: [
'babel-plugin-syntax-async-generators',
'babel-plugin-syntax-trailing-function-commas',
'babel-plugin-transform-async-to-module-method',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-decorators-legacy',
'babel-plugin-transform-runtime',
'babel-plugin-transform-es2015-destructuring',
'babel-plugin-transform-es2015-function-name',
'babel-plugin-transform-es2015-modules-commonjs',
'babel-plugin-transform-es2015-parameters',
'babel-plugin-transform-es2015-sticky-regex',
'babel-plugin-transform-es2015-unicode-regex',
'babel-plugin-transform-eval',
'babel-plugin-transform-object-assign',
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-proto-to-assign',
'babel-plugin-transform-react-display-name',
'babel-plugin-transform-react-jsx',
'babel-plugin-transform-undefined-to-void',
['babel-plugin-transform-async-to-module-method', {
'module': 'bluebird',
'method': 'coroutine',
}],
'babel-plugin-transform-react-jsx',
['babel-plugin-css-modules-transform', {
'prepend': ['postcss-cssnext'],
}],
],
sourceMaps: 'both',
retainLines: true,
}; |
Thank you. One more question, you mentioned that you want to pass specific options to |
With // postcssConfig.js
import postcssCssnext from 'postcss-cssnext';
import constants from './lib/css/constants';
const { properties, media } = constants;
export default {
postcssCssnext: postcssCssnext({
features: {
customProperties: {
variables: properties,
},
customMedia: {
extensions: media,
},
},
}),
}; And i use this file with webpack (in order to build my front bundle): // webpackConfig.js
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import postcssConfig from './postcssConfig';
const { postcssCssnext } = postcssConfig;
export default {
...
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract(
'style-loader',
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'),
}
],
},
postcss: () => [postcssCssnext],
plugins: [
new ExtractTextPlugin(path.resolve(__dirname, '/path/to/bundle/c.css'), {
allChunks: true,
}),
],
} |
You can do it already. Only thing you need to do is to create javascript file, where you import You can try this: // postcss.js
import postcssCssnext from 'postcss-cssnext';
import constants from './lib/css/constants';
const { properties, media } = constants;
export default () => postcssCssnext({
features: {
customProperties: {
variables: properties,
},
customMedia: {
extensions: media,
},
},
}); and then set I am writing this on the fly, so it's not tested. |
Hmmm, when Then it try a second time here: I think its because of |
Is this path to a plugin relative to the |
my JS file and i run my gulp task at But value of |
Try to change it to
|
It works 👍 with the update at It's nice! |
Ok now you can update it, released as |
I'd just like to add a comment that I solved the issue of not passing options by doing this in my webpack babel loader:
|
Hi again!
Today, i tested new released tag 0.0.8, with my prepend config:
It Works 👍
But, currently i can't pass specific opts for
postcss-cssnext
:I don't know if your plugin is designed in order to do specifics configuration.
And i got some troubles with 'postcss-import' module because it seems to be async :
css-modules/css-modules-require-hook#58
The text was updated successfully, but these errors were encountered: