Skip to content
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

Added postCSS functionality #77

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 44 additions & 24 deletions conf/webpack/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,56 +99,57 @@ class WebpackBaseConfig {
presets: ['es2015']
}
},
{
test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/,
loader: 'file-loader'
},
{
test: /^.((?!cssmodule).)*\.css$/,
loaders: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
{
loader: 'css-loader',
query: { importLoaders: 1 }
},
{ loader: 'postcss-loader' }
]
},
{
test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/,
loader: 'file-loader'
},
{
test: /^.((?!cssmodule).)*\.(sass|scss)$/,
loaders: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{
loader: 'css-loader',
query: { importLoaders: 1 }
},
{ loader: 'postcss-loader' },
{ loader: 'sass-loader' }
]
},
{
test: /^.((?!cssmodule).)*\.less$/,
loaders: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{
loader: 'css-loader',
query: { importLoaders: 1 }
},
{ loader: 'postcss-loader' },
{ loader: 'less-loader' }
]
},
{
test: /^.((?!cssmodule).)*\.styl$/,
loaders: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{
loader: 'css-loader',
query: { importLoaders: 1 }
},
{ loader: 'postcss-loader' },
{ loader: 'stylus-loader' }
]
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(js|jsx)$/,
include: [].concat(
this.includedPackages,
[this.srcPathAbsolute]
),
loaders: [
// Note: Moved this to .babelrc
{ loader: 'babel-loader' }
]
},
{
test: /\.cssmodule\.(sass|scss)$/,
loaders: [
Expand All @@ -157,6 +158,7 @@ class WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'sass-loader' }
]
},
Expand All @@ -167,7 +169,8 @@ class WebpackBaseConfig {
{
loader: 'css-loader',
query: cssModulesQuery
}
},
{ loader: 'postcss-loader' }
]
},
{
Expand All @@ -178,6 +181,7 @@ class WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'less-loader' }
]
},
Expand All @@ -189,8 +193,24 @@ class WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'stylus-loader' }
]
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(js|jsx)$/,
include: [].concat(
this.includedPackages,
[this.srcPathAbsolute]
),
loaders: [
// Note: Moved this to .babelrc
{ loader: 'babel-loader' }
]
}
]
},
Expand Down
6 changes: 5 additions & 1 deletion conf/webpack/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class WebpackTestConfig extends WebpackBaseConfig {
{
loader: 'css-loader',
query: cssModulesQuery
}
},
{ loader: 'postcss-loader' }
]
},
{
Expand All @@ -48,6 +49,7 @@ class WebpackTestConfig extends WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'less-loader' }
]
},
Expand All @@ -59,6 +61,7 @@ class WebpackTestConfig extends WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'stylus-loader' }
]
},
Expand All @@ -70,6 +73,7 @@ class WebpackTestConfig extends WebpackBaseConfig {
loader: 'css-loader',
query: cssModulesQuery
},
{ loader: 'postcss-loader' },
{ loader: 'sass-loader' }
]
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
"mocha": "^3.0.0",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "^2.1.7",
"postcss": "^5.2.6",
"postcss-loader": "^1.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stylesuxx just checked that these two deps are added automatically on the generator-side if the user answers the PostCSS prompt with yes. Could you remove them from here?

"react-addons-test-utils": "^15.0.1",
"rimraf": "^2.5.2",
"sinon": "^1.17.3",
Expand Down
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = () => ({
plugins: []
});