Skip to content

Commit 1cd7e21

Browse files
committed
Make ctx backward compatible with 9.0.0
1 parent 65cb119 commit 1cd7e21

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ function withConfigLoader(cb) {
127127
} else {
128128
configPath = file.dirname
129129
}
130+
// @TODO: The options property is deprecated and should be removed in 10.0.0.
131+
contextOptions.options = Object.assign({}, contextOptions)
130132
contextOptions.file = file
131133
return postcssLoadConfig(
132134
contextOptions,

test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ describe('PostCSS Guidelines', function () {
329329
stream.on('data', function () {
330330
assert.deepEqual(postcssLoadConfigStub.getCall(0).args[0], {
331331
file: file,
332-
to: 'initial'
332+
to: 'initial',
333+
options: { to: 'initial' }
333334
})
334335
assert.equal(postcssStub.use.getCall(0).args[0], plugins)
335336
assert.equal(postcssStub.process.getCall(0).args[1].to, 'overriden')

0 commit comments

Comments
 (0)