Skip to content

Commit

Permalink
Update to PostCSS 8. Require NodeJS 10+
Browse files Browse the repository at this point in the history
  • Loading branch information
klimashkin committed Sep 26, 2020
1 parent b13ac8c commit fc11952
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
.*

!.npmrc
!.gitignore
!.editorconfig
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This webpack plugin gets css extracted by [MiniCssExtractPlugin](https://github.
If you use postcss-loader, not all its plugins are effective in file-by-file processing. For instance, css structural optimizations or media query packaging better apply to one css production file that can be generated by MiniCssExtractPlugin.

# Installation
`npm i postcss-assets-webpack-plugin`
`npm install --save-dev webpack postcss postcss-assets-webpack-plugin`

# Options
* `test` - regular expression for matching files returned from MiniCssExtractPlugin.
Expand All @@ -22,15 +22,15 @@ import mqpacker from 'mqpacker';
import autoprefixer from 'autoprefixer';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import PostCSSAssetsPlugin from 'postcss-assets-webpack-plugin';

const devMode = process.env.NODE_ENV !== 'production'

webpackConfig = {
<...>
postcss() {
return [autoprefixer({browser: 'last 2 version', cascade: false})]
},

module: {
rules: [
{
Expand Down Expand Up @@ -61,13 +61,13 @@ webpackConfig = {
}
],
},

plugins: [
new MiniCssExtractPlugin({
filename: devMode ? '[name].css' : '[name].[hash].css',
chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
})

new PostCSSAssetsPlugin({
test: /\.css$/,
log: true,
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
},
"main": "index.js",
"peerDependencies": {
"webpack": "^4.10.2"
"postcss": "^8.0.9",
"webpack": "^4.40.0"
},
"devDependencies": {
"postcss": "^8.0.9",
"webpack": "^4.40.0"
},
"dependencies": {
"fancy-log": "^1.3.2",
"fancy-log": "^1.3.3",
"human-size": "^1.1.0",
"postcss": "^7.0.0",
"webpack-sources": "^1.1.0"
"webpack-sources": "^1.4.0"
},
"keywords": [
"css",
Expand All @@ -33,6 +37,6 @@
"postcss-assets-webpack-plugin"
],
"engines": {
"node": ">=6.0.0"
"node": ">=10.0.0"
}
}

0 comments on commit fc11952

Please sign in to comment.