Skip to content

Commit 3bfa2dd

Browse files
committed
Don't reorder core plugins
1 parent 4d4f4ca commit 3bfa2dd

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
### HEAD
22

3+
* Pin core plugins order:
4+
5+
`postcss-easy-import`
6+
[ user plugins ]
7+
[ encapsulation plugins ]
8+
`autoprefixer`
9+
`postcss-reporter`
10+
* Add experimental `encapsulate` option/feature
311
* CLI flags override config file options
412
* Input file is now linted (previously only imported files were passed through
513
the linting tools)

lib/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,14 @@ function mergeOptions(options) {
133133
// but remove any duplicates so that it respects the new order
134134
if (!isEmpty(options.use)) {
135135
var plugins = difference(mergedOpts.use, options.use);
136-
mergedOpts.use = plugins.concat(options.use);
136+
// Remove core plugins. Can't reorder them
137+
var userPlugins = difference(options.use, [
138+
'postcss-easy-import',
139+
'autoprefixer',
140+
'postcss-reporter'
141+
]);
142+
mergedOpts.use = plugins.concat(userPlugins);
137143
}
138-
139144
return mergedOpts;
140145
}
141146

test/options.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('re-ordering the `use` array of postcss plugins', function() {
6363

6464
it('should allow reordering of use array and remove duplicates', function() {
6565
var opts = mergeOptions({
66-
use: ['postcss-at2x', 'postcss-calc']
66+
use: ['postcss-at2x', 'postcss-easy-import', 'postcss-calc']
6767
});
6868

6969
expect(opts.use).to.eql([

0 commit comments

Comments
 (0)