Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-loader

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-loader - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

.editorconfig

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## 0.7
* Added argument with webpack instance to plugins callback (by Maxime Thirouin).
## 0.6

@@ -2,0 +5,0 @@ * Use PostCSS 5.0.

2

index.js

@@ -28,3 +28,3 @@ var loaderUtils = require('loader-utils');

if ( typeof plugins === 'function' ) {
plugins = plugins.call(this);
plugins = plugins.call(this, this);
}

@@ -31,0 +31,0 @@

{
"name": "postcss-loader",
"version": "0.6.0",
"version": "0.7.0",
"description": "PostCSS loader for webpack",

@@ -14,12 +14,12 @@ "keywords": ["webpack", "loader", "css", "postcss", "postcss-runner"],

"loader-utils": "^0.2.11",
"postcss": "^5.0.0"
"postcss": "^5.0.10"
},
"devDependencies": {
"postcss-safe-parser": "1.0.0",
"webpack-stream": "2.1.0",
"postcss-safe-parser": "1.0.1",
"webpack-stream": "2.1.1",
"gulp-eslint": "1.0.0",
"gulp-mocha": "2.1.3",
"raw-loader": "0.5.1",
"fs-extra": "0.23.1",
"chai": "3.2.0",
"fs-extra": "0.24.0",
"chai": "3.3.0",
"gulp": "3.9.0"

@@ -26,0 +26,0 @@ },

@@ -25,3 +25,3 @@ # PostCSS for Webpack [![Build Status][ci-img]][ci]

var autoprefixer = require('autoprefixer');
var cssnext = require('cssnext');
var precss = require('precss');

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

postcss: function () {
return [autoprefixer, cssnext];
return [autoprefixer, precss];
}

@@ -57,3 +57,3 @@ }

postcss: function () {
return [autoprefixer, cssnext];
return [autoprefixer, precss];
}

@@ -89,3 +89,3 @@ }

return {
defaults: [autoprefixer, cssnext],
defaults: [autoprefixer, precss],
cleaner: [autoprefixer({ browsers: [] })]

@@ -103,9 +103,6 @@ };

Since the function in postcss section is executed with
the [webpack loader-context], we can use the postcss-import callback
[onImport] to tell webpack what files need to be watched.
Here is a simple way to let know postcss-import to pass files to webpack:
```js
var cssimport = require('postcss-import');
var autoprefixer = require('autoprefixer-core');
var postcssImport = require('postcss-import');

@@ -121,16 +118,7 @@ module.exports = {

},
postcss: function () {
// The context of this function is the webpack loader-context
// see: http://webpack.github.io/docs/loaders.html#loader-context
postcss: function (webpack) {
return [
cssimport({
// see postcss-import docs to learn about onImport callback
// https://github.com/postcss/postcss-import
onImport: function (files) {
files.forEach(this.addDependency);
}.bind(this)
}),
autoprefixer
postcssImport({
addDependencyTo: webpack
})
];

@@ -143,3 +131,2 @@ }

[postcss-import]: https://github.com/postcss/postcss-import
[onImport]: https://github.com/postcss/postcss-import#onimport

@@ -146,0 +133,0 @@ ## Custom Syntaxes

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc