Socket
Socket
Sign inDemoInstall

postcss-loader

Package Overview
Dependencies
36
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.6 to 3.0.0

src/Error.js

22

CHANGELOG.md

@@ -5,2 +5,24 @@ # Change Log

<a name="3.0.0"></a>
# [3.0.0](https://github.com/postcss/postcss-loader/compare/v2.1.6...v3.0.0) (2018-08-08)
### Bug Fixes
* **index:** add ast version (`meta.ast`) ([f34954f](https://github.com/postcss/postcss-loader/commit/f34954f))
* **index:** emit `warnings` as an instance of `{Error}` ([8ac6fb5](https://github.com/postcss/postcss-loader/commit/8ac6fb5))
* **options:** improved `ValidationError` messages ([549ea08](https://github.com/postcss/postcss-loader/commit/549ea08))
### Chores
* **package:** update `postcss` v6.0.0...7.0.0 (`dependencies`) ([#375](https://github.com/postcss/postcss-loader/issues/375)) ([daa0da8](https://github.com/postcss/postcss-loader/commit/daa0da8))
### BREAKING CHANGES
* **package:** requires `node >= v6.0.0`
<a name="2.1.6"></a>

@@ -7,0 +29,0 @@ ## [2.1.6](https://github.com/postcss/postcss-loader/compare/v2.1.5...v2.1.6) (2018-07-10)

25

package.json
{
"name": "postcss-loader",
"version": "2.1.6",
"version": "3.0.0",
"description": "PostCSS loader for webpack",
"main": "lib/index.js",
"main": "src/index.js",
"files": [
"lib"
"src"
],
"engines": {
"node": ">= 4"
"node": ">= 6"
},
"dependencies": {
"loader-utils": "^1.1.0",
"postcss": "^6.0.0",
"postcss": "^7.0.0",
"postcss-load-config": "^2.0.0",
"schema-utils": "^0.4.0"
"schema-utils": "^1.0.0"
},
"devDependencies": {
"jest": "^22.0.0",
"@webpack-utilities/test": "^1.0.0-alpha.0",
"jest": "^23.0.0",
"jsdoc-to-markdown": "^4.0.0",
"memory-fs": "^0.4.0",
"postcss-import": "^11.0.0",
"postcss-js": "^1.0.0",
"postcss-js": "^2.0.0",
"standard": "^11.0.0",
"standard-version": "^4.0.0",
"sugarss": "^1.0.0",
"util.promisify": "^1.0.0",
"webpack": "^3.0.0"
"webpack": "^4.0.0"
},
"scripts": {
"lint": "standard --env jest",
"test": "jest --verbose --coverage",
"docs": "jsdoc2md lib/index.js > LOADER.md",
"test": "jest --env node --verbose --coverage",
"docs": "jsdoc2md src/*.js > docs/LOADER.md",
"clean": "rm -rf coverage test/outputs",

@@ -35,0 +34,0 @@ "release": "standard-version"

@@ -11,3 +11,3 @@ [![npm][npm]][npm-url]

alt="PostCSS Logo"
src="http://postcss.github.io/postcss/logo.svg">
src="https://api.postcss.org/logo.svg">
<a href="https://github.com/webpack/webpack">

@@ -24,3 +24,3 @@ <img width="200" height="200" hspace="10"

<h1>PostCSS Loader</h1>
<p>Loader for <a href="http://webpack.js.org/">webpack</a> to process CSS with <a href="http://postcss.org/">PostCSS</a></p>
<p>Loader for <a href="https://webpack.js.org/">webpack</a> to process CSS with <a href="https://postcss.org/">PostCSS</a></p>
</div>

@@ -38,3 +38,3 @@

**postcss.config.js**
**`postcss.config.js`**
```js

@@ -45,3 +45,3 @@ module.exports = {

'postcss-import': {},
'postcss-cssnext': {},
'postcss-preset-env': {},
'cssnano': {}

@@ -79,3 +79,3 @@ }

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -96,3 +96,3 @@ module.exports = {

**webpack.config.js (recommended)**
**`webpack.config.js` (recommended)**
```js

@@ -131,2 +131,3 @@ module.exports = {

**`webpack.config.js`**
```js

@@ -147,3 +148,3 @@ {

|:--:|:--:|:-----:|:----------|
|[`path`](#path)|`{String}`|`undefined`|PostCSS Config Path|
|[`path`](#path)|`{String}`|`undefined`|PostCSS Config Directory|
|[`context`](#context)|`{Object}`|`undefined`|PostCSS Config Context|

@@ -157,3 +158,5 @@

**webpack.config.js**
> ⚠️ Note that you **can't** use a **filename** other than the [supported config formats] (e.g `.postcssrc.js`, `postcss.config.js`), this option only allows you to manually specify the **directory** where config lookup should **start** from
**`webpack.config.js`**
```js

@@ -164,3 +167,4 @@ {

config: {
path: 'path/to/postcss.config.js'
path: 'path/to/.config/' ✅
path: 'path/to/.config/css.config.js' ❌
}

@@ -171,2 +175,4 @@ }

[supported config formats]: https://github.com/michael-ciniawsky/postcss-load-config#usage
#### `Context (ctx)`

@@ -182,3 +188,3 @@

**postcss.config.js**
**`postcss.config.js`**
```js

@@ -189,4 +195,3 @@ module.exports = ({ file, options, env }) => ({

'postcss-import': { root: file.dirname },
'postcss-cssnext': options.cssnext ? options.cssnext : false,
'autoprefixer': env === 'production' ? options.autoprefixer : false,
'postcss-preset-env': options['postcss-preset-env'] ? options['postcss-preset-env'] : false,
'cssnano': env === 'production' ? options.cssnano : false

@@ -197,3 +202,3 @@ }

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -205,5 +210,4 @@ {

ctx: {
cssnext: {...options},
'postcss-preset-env': {...options},
cssnano: {...options},
autoprefixer: {...options}
}

@@ -217,3 +221,3 @@ }

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -226,4 +230,3 @@ {

require('postcss-import')({ root: loader.resourcePath }),
require('postcss-cssnext')(),
require('autoprefixer')(),
require('postcss-preset-env')(),
require('cssnano')()

@@ -247,3 +250,3 @@ ]

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -261,3 +264,3 @@ {

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -275,3 +278,3 @@ {

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -291,3 +294,3 @@ {

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -310,3 +313,3 @@ {

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -331,3 +334,3 @@ {

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -354,2 +357,27 @@ {

### `Autoprefixing`
**`webpack.config.js`**
```js
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
require('autoprefixer')({...options}),
...,
]
}
}
]
}
```
> :warning: [`postcss-preset-env`](https://github.com/csstools/postcss-preset-env) includes [`autoprefixer`](https://github.com/postcss/autoprefixer), so adding it separately is not necessary if you already use the preset.
### `CSS Modules`

@@ -361,3 +389,3 @@

**webpack.config.js**
**`webpack.config.js`**
```js

@@ -379,3 +407,3 @@ {

[CSS Modules]: https://github.com/webpack/css-loader#css-modules
[postcss-modules]: https://github.com/outpunk/postcss-modules
[postcss-modules]: https://github.com/css-modules/postcss-modules

@@ -388,2 +416,3 @@ ### `CSS-in-JS`

**`webpack.config.js`**
```js

@@ -426,8 +455,10 @@ {

[ExtractPlugin]: https://github.com/webpack-contrib/extract-text-webpack-plugin
[ExtractPlugin]: https://github.com/webpack-contrib/mini-css-extract-plugin
**webpack.config.js**
**`webpack.config.js`**
```js
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const devMode = process.env.NODE_ENV !== 'production'
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = {

@@ -438,9 +469,7 @@ module: {

test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
})
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader'
]
}

@@ -450,3 +479,5 @@ ]

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

@@ -489,3 +520,3 @@ }

[tests]: http://img.shields.io/travis/postcss/postcss-loader.svg
[tests]: https://img.shields.io/travis/postcss/postcss-loader.svg
[tests-url]: https://travis-ci.org/postcss/postcss-loader

@@ -492,0 +523,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc