Skip to content

Instantly share code, notes, and snippets.

@azu
Last active January 17, 2017 22:21
Show Gist options
  • Save azu/7a33416ca425b031d6b3cd127410b015 to your computer and use it in GitHub Desktop.
Save azu/7a33416ca425b031d6b3cd127410b015 to your computer and use it in GitHub Desktop.
PostCSS の設定ファイル(buildとlint)
/**
* PostCSS の設定ファイル
*/
const doiuse = require('doiuse');
const cssnano = require('cssnano');
const reporter = require('postcss-reporter');
const easyImport = require('postcss-easy-import');
const atApply = require('postcss-apply');
const autpPrefixer = require('autoprefixer');
const customProperties = require('postcss-custom-properties');
const calc = require('postcss-calc');
const flexBugsFixes = require('postcss-flexbugs-fixes');
const browsers = [
'last 1 version',
'ie >= 11'
];
const config = {
build: [
easyImport({glob: true}),
atApply,
customProperties(),
calc(),
flexBugsFixes(),
autpPrefixer({browsers: browsers}),
cssnano()
],
lint: [
easyImport({glob: true}),
atApply,
customProperties(),
calc(),
doiuse({browsers: browsers, ignore: [
'css-resize',
'pointer-events',
'text-size-adjust',
'css-appearance',
'css-transitions',
'will-change', // 対応してなくても動作には問題ない
'css3-cursors',
'flexbox', // Warning: IE11>=
'viewport-units' //Warning: 3D transforms+IE11
]}),
reporter()
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment