chore: add postcss-loader and autoprefixer (#13)

This commit is contained in:
olOwOlo 2017-10-12 22:38:56 +08:00
parent add55547f5
commit 3483df9d83
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
5 changed files with 21 additions and 21 deletions

View file

@ -9,6 +9,7 @@
"author": "ahonn, olOwOlo", "author": "ahonn, olOwOlo",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.5",
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
@ -19,10 +20,11 @@
"extract-text-webpack-plugin": "^3.0.0", "extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2", "file-loader": "^0.11.2",
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"postcss-loader": "^2.0.7",
"sass-loader": "^6.0.6", "sass-loader": "^6.0.6",
"style-loader": "^0.18.2", "style-loader": "^0.18.2",
"uglifyjs-webpack-plugin": "^0.4.6", "uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.9", "url-loader": "^0.5.9",
"webpack": "^3.5.5" "webpack": "^3.7.1"
} }
} }

7
src/postcss.config.js Normal file
View file

@ -0,0 +1,7 @@
module.exports = {
plugins: [
require('autoprefixer')({
browsers: ['> 1%', 'last 2 versions', 'ie >= 9']
})
]
}

View file

@ -1,10 +1,10 @@
const path = require('path'); const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-plugin"); const ExtractTextPlugin = require("extract-text-webpack-plugin")
const UglifyJSPlugin = require('uglifyjs-webpack-plugin') const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const extractSass = new ExtractTextPlugin({ const extractSass = new ExtractTextPlugin({
filename: `even.min.css` filename: `even.min.css`
}); })
module.exports = { module.exports = {
devtool: 'source-map', devtool: 'source-map',
@ -26,31 +26,22 @@ module.exports = {
test: /\.scss$/, test: /\.scss$/,
use: extractSass.extract({ use: extractSass.extract({
use: [{ use: [{
loader: 'css-loader', loader: 'css-loader', options: {minimize: true, sourceMap: true}
options: {
minimize: true,
sourceMap: true
}
}, { }, {
loader: 'sass-loader', loader: 'postcss-loader', options: {sourceMap: true}
options: { }, {
sourceMap: true loader: 'sass-loader', options: {sourceMap: true}
}
}], }],
fallback: 'style-loader' fallback: 'style-loader'
}) })
}, },
{ {
test: /iconfont\.(woff|woff2|eot|ttf|otf|svg)$/, test: /iconfont\.(woff|woff2|eot|ttf|otf|svg)$/,
use: [ use: ['file-loader?name=[path][name].[ext]?hash=[hash:7]']
'file-loader?name=[path][name].[ext]?hash=[hash:7]'
]
}, },
{ {
test: /apple-chancery-webfont\.(woff|woff2|eot|ttf|otf|svg)$/, test: /apple-chancery-webfont\.(woff|woff2|eot|ttf|otf|svg)$/,
use: [ use: ['file-loader?name=[path][name].[ext]']
'file-loader?name=[path][name].[ext]'
]
} }
] ]
}, },

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long