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

Update PostCSS & Autoprefixer configs #580

Merged
merged 2 commits into from
Feb 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "npm run build:commonjs && npm run build:css && npm run build:es && npm run build:demo && npm run build:umd",
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel source --out-dir dist/commonjs --ignore *.example.js,*.test.js,source/demo/,source/tests.js",
"build:css": "postcss --use autoprefixer source/styles.css > styles.css",
"build:css": "postcss --config postcss.config.js --use autoprefixer source/styles.css > styles.css",
"build:demo": "npm run clean:demo && cross-env NODE_ENV=production webpack --config webpack.config.demo.js -p --bail",
"build:es": "npm run clean:es && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel source --out-dir dist/es --ignore *.example.js,*.test.js,source/demo/,source/tests.js",
"build:umd": "npm run clean:umd && cross-env NODE_ENV=production webpack --config webpack.config.umd.js --bail",
Expand Down
9 changes: 9 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
"autoprefixer": {
"browsers": ["last 2 version", "Firefox 15", "iOS 8"],
},
// The plugins section is used by postcss-loader with webpack
plugins: [
require('autoprefixer'),
],
}
5 changes: 1 addition & 4 deletions webpack.config.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ module.exports = {
},
{
test: /\.css$/,
loaders: ['style', 'css?importLoaders=1'],
loaders: ['style', 'css?importLoaders=1&minimize=false'],
include: path.join(__dirname, 'styles.css')
}
]
},
postcss: function () {
return [autoprefixer]
}
}
5 changes: 1 addition & 4 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ const config = {
},
{
test: /\.css$/,
loaders: ['style', 'css?importLoaders=1'],
loaders: ['style', 'css?importLoaders=1&minimize=false'],
include: path.join(__dirname, 'styles.css')
}
]
},
postcss: function () {
return [autoprefixer]
},
devServer: {
contentBase: 'build',
port: 3001,
Expand Down
12 changes: 0 additions & 12 deletions webpack.config.umd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const path = require('path')
const webpack = require('webpack')

Expand All @@ -19,11 +18,6 @@ module.exports = {
'react-addons-shallow-compare': 'var React.addons.shallowCompare'
},
plugins: [
new ExtractTextPlugin('../styles.css', {
allChunks: false,
beautify: true,
mangle: false
}),
new webpack.optimize.UglifyJsPlugin({
beautify: true,
comments: true,
Expand All @@ -36,12 +30,6 @@ module.exports = {
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'source')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('css-loader!autoprefixer-loader?{browsers:["last 2 version", "Firefox 15"]}'),
include: path.join(__dirname, 'source')

}
]
}
Expand Down