Skip to content

Commit

Permalink
Merge pull request #580 from clauderic/autoprefixer-config
Browse files Browse the repository at this point in the history
Update PostCSS & Autoprefixer configs
  • Loading branch information
bvaughn authored Feb 16, 2017
2 parents eedbe2b + cb071d9 commit c461d67
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
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

0 comments on commit c461d67

Please sign in to comment.