Skip to content

Commit

Permalink
added autoprefixer code with postcss loader
Browse files Browse the repository at this point in the history
  • Loading branch information
shakcho committed Jun 13, 2019
1 parent 165a8d1 commit 5763760
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"null-loader": "^3.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"portfinder": "^1.0.20",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.6.0",
"react-dev-utils": "^9.0.1",
"react-helmet": "^6.0.0-beta",
"react-loadable": "^5.5.0",
Expand Down
20 changes: 20 additions & 0 deletions packages/docusaurus/src/webpack/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ export function getStyleLoaders(
loader: require.resolve('css-loader'),
options: cssOptions,
},
{
// Options for PostCSS as we reference these options twice
// Adds vendor prefixing based on your specified browser support in
// package.json
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
}),
],
},
},
].filter(Boolean) as Loader[];
return loaders;
}
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 30 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
Expand Down

0 comments on commit 5763760

Please sign in to comment.