Skip to content

Commit

Permalink
Apply autoprefixer for example
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed Nov 29, 2016
1 parent 42f661c commit 4c054f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"node-sass": "^3.10.0",
"npm-run-all": "^3.0.0",
"postcss": "^5.2.4",
"postcss-loader": "^1.1.1",
"power-assert": "^1.3.1",
"rollup": "^0.36.0",
"rollup-plugin-babel": "^2.6.1",
Expand Down
18 changes: 17 additions & 1 deletion scripts/webpack.config.example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
const path = require('path')
const webpack = require('webpack')
const autoprefixer = require('autoprefixer')

const postcss = [
autoprefixer({
browsers: ['> 1%', 'last 2 versions', 'IE >= 9']
})
]

module.exports = {
context: path.resolve(__dirname, '../example'),
Expand All @@ -21,10 +29,18 @@ module.exports = {
rules: [
{ enforce: 'pre', test: /\.scss/, loader: 'sass-loader' },
{ test: /\.js$/, loader: 'babel-loader', exclude: /(node_modules|dist)/ },
{ test: /\.s?css$/, loader: 'style-loader!css-loader' },
{ test: /\.s?css$/, loader: 'style-loader!css-loader!postcss-loader' },
{ test: /\.vue$/, loader: 'vue-loader' }
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
test: /\.s?css$/,
options: {
postcss
}
})
],
devServer: {
contentBase: './example'
}
Expand Down

0 comments on commit 4c054f7

Please sign in to comment.