Permalink
Browse files

Fixed: `compress` option now works again correctly (1.8.4)

Close #195
Close #194
  • Loading branch information...
1 parent 8710e43 commit b5ece99c1e1b5e4cdfd6c25f856946bbcbc2247c @MoOx committed Aug 25, 2015
View
@@ -11,6 +11,3 @@ indent_size = 2
[*.md]
trim_trailing_whitespace = false
-
-[Makefile]
-indent_style = tab
View
@@ -1,3 +1,12 @@
+# 1.8.4 - 2015-08-24
+
+- Fixed: `compress` option now works again correctly. A recent update in cssnano
+has introduced some minor breaking changes the way cssnext changed plugins
+metadata (`pluginName`).
+A direct minor change is that `messages` (in console or in css output) now show
+real origin (postcss plugin name) instead of a vague "cssnext" origin.
+([#195](https://github.com/cssnext/cssnext/issues/195))
+
# 1.8.3 - 2015-08-06
- Fixed: `url` option (postcss-url) have been updated in order to benefit from
View
@@ -1,6 +1,6 @@
{
"name": "cssnext",
- "version": "1.8.3",
+ "version": "1.8.4",
"description": "Use tomorrow's CSS syntax, today",
"keywords": [
"css",
@@ -35,7 +35,7 @@
"chalk": "^1.0.0",
"chokidar": "^1.0.0",
"commander": "^2.3.0",
- "cssnano": "^2.0.1",
+ "cssnano": "^2.6.1",
"exit": "^0.1.2",
"mkdirp": "^0.5.1",
"pixrem": "^1.1.0",
@@ -80,8 +80,8 @@
"cssrecipes-grid": "^0.4.0",
"cssrecipes-utils": "^0.5.0",
"cssrecipes-vertical-rhythm": "^0.6.0",
- "eslint": "^1.0.0-rc-1",
- "eslint-loader": "^0.14.2",
+ "eslint": "^1.0.0",
+ "eslint-loader": "^1.0.0",
"eslint-plugin-react": "^3.0.0",
"extract-text-webpack-plugin": "^0.8.0",
"file-loader": "^0.8.3",
@@ -1,6 +1,5 @@
/*! sha */
-/* blah */
body {
- color : red;
+ color : black;
}
@@ -1 +1 @@
-/*! sha */body{color:red}
+/*! sha */body{color:#000}
@@ -1 +1 @@
-body{color:red}
+/*! sha */body{color:black}
@@ -14,19 +14,34 @@ test("cssnext compress option", function(t) {
options: utils.readFixture("compress.options.expected").trim(),
}
- // compress option
t.equal(
- cssnext(input, {compress: true}).trim(),
+ cssnext(
+ input,
+ {
+ compress: true,
+ }
+ ).trim(),
expected.default,
"should be able to compress"
)
t.equal(
- cssnext(input, {compress: {comments: {removeAll: true}}}).trim(),
+ cssnext(
+ input,
+ {
+ compress: {
+ colormin: false,
+ },
+ }
+ ).trim(),
expected.options,
"should be able to compress with options"
)
t.equal(
- postcss().use(cssnext({compress: true})).process(input).css.trim(),
+ postcss().use(
+ cssnext({
+ compress: true,
+ })
+ ).process(input).css.trim(),
expected.default,
"should be able to compress even as a postcss plugin"
)
View
@@ -83,7 +83,6 @@ function cssnext(string, options) {
? {...options.import}
: undefined
)
- plugin.postcssPlugin = "cssnext"
postcss.use(plugin)
}
@@ -94,7 +93,6 @@ function cssnext(string, options) {
? {...options.url}
: undefined
)
- plugin.postcssPlugin = "cssnext"
postcss.use(plugin)
}
}
@@ -129,7 +127,6 @@ function cssnext(string, options) {
? {...features[key]}
: undefined
)
- plugin.postcssPlugin = "cssnext"
postcss.use(plugin)
}
})
@@ -147,9 +144,8 @@ function cssnext(string, options) {
// minification
if (options.compress) {
- const nano = require("cssnano")
postcss.use(
- nano(
+ require("cssnano")(
typeof options.compress === "object"
? options.compress
: {}
@@ -162,7 +158,6 @@ function cssnext(string, options) {
// (which make sense)
if (options.messages) {
optionMessages(options).forEach(plugin => {
- plugin.postcssPlugin = "cssnext"
postcss.use(plugin)
})
}
View
@@ -46,12 +46,10 @@ module.exports = {
],
},
- plugins: (
- [
- new webpack.DefinePlugin(buildConfig),
- new ExtractTextPlugin("[name].css", {disable: !buildConfig.__PROD__}),
- ]
- .concat(
+ plugins: ([
+ new webpack.DefinePlugin(buildConfig),
+ new ExtractTextPlugin("[name].css", {disable: !buildConfig.__PROD__}),
+ ].concat(
buildConfig.__PROD__
? [
new webpack.optimize.DedupePlugin(),

0 comments on commit b5ece99

Please sign in to comment.