Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 79feeba

Browse files
committed
from option doesn't enable sourcemap automatically anymore
1 parent fe58bb3 commit 79feeba

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# 1.0.0 - unreleased
1+
# 0.2.0 - 2014-08-20
2+
3+
- `from` option doesn't enable `sourcemap` automatically anymore
4+
5+
# 0.1.0 - 2014-08-19
26

37
First release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ If you want better control on sourcemap, use [postcss `map` option](https://gith
152152

153153
##### `from` (default: `null`)
154154

155-
Source of the file. **Enable `sourcemap` option automatically** (except if you provide both `from` & `sourcemap`).
155+
Source of the file. Needed for sourcemap.
156156

157157
```js
158158
var cssnext = require("cssnext")

bin/cssnext

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function transform() {
6666
var css = cssnext(buffer.toString(), {
6767
features: program,
6868
from: input,
69-
sourcemap: Boolean(program.sourcemap),
69+
sourcemap: program.sourcemap,
7070
compress: program.compress
7171
})
7272

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ function cssnext(string, options) {
3434
// default sourcemap
3535
// if `map` option is passed, `sourcemap` option is ignored
3636
// if `sourcemap` option is passed, a default map is used (insert content in the output)
37-
// if `from` option is passed, we assume sourcemap is wanted
3837
options.map = options.map ||
3938
(
40-
(options.sourcemap || (options.sourcemap !== false && options.from)) ?
39+
options.sourcemap ?
4140
{
4241
inline: true,
4342
sourcesContent: true

test/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ test("sourcemap", function(t) {
7171
t.equal(
7272
cssnext(
7373
read("sourcemap/input"),
74-
{from: "./test/sourcemap/input.css"}
74+
{
75+
from: "./test/sourcemap/input.css",
76+
sourcemap: true
77+
}
7578
).trim(),
7679
read("sourcemap/expected").trim(),
7780
"should contain a correct sourcemap"

0 commit comments

Comments
 (0)