Skip to content

Commit edcd28c

Browse files
committed
Merge pull request #29 from suitcss/postcss-easy-import
Switch to postcss-easy-import
2 parents 777940c + 37a23cc commit edcd28c

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ various [PostCSS](https://github.com/postcss/postcss) plugins.
99

1010
Compiles CSS packages with:
1111

12-
* [postcss-import](https://github.com/postcss/postcss-import)
12+
* [postcss-easy-import](https://github.com/TrySound/postcss-easy-import)
1313
* [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties)
1414
* [postcss-calc](https://github.com/postcss/postcss-calc)
1515
* [postcss-custom-media](https://github.com/postcss/postcss-custom-media)
@@ -258,7 +258,7 @@ If duplicate plugins are used they will be removed, but the new order will be re
258258
```js
259259
// Default order
260260
var defaults = [
261-
'postcss-import',
261+
'postcss-easy-import',
262262
'postcss-custom-properties',
263263
'postcss-calc',
264264
'postcss-custom-media',
@@ -277,7 +277,7 @@ module.exports = {
277277
};
278278

279279
var result = [
280-
'postcss-import',
280+
'postcss-easy-import',
281281
'postcss-custom-properties',
282282
'postcss-custom-media',
283283
'postcss-at2x',

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ var defaults = {
2424
minify: false,
2525
lint: false,
2626
use: [
27-
'postcss-import',
27+
'postcss-easy-import',
2828
'postcss-custom-properties',
2929
'postcss-calc',
3030
'postcss-custom-media',
3131
'autoprefixer',
3232
'postcss-reporter'
3333
],
34-
'postcss-import': {
34+
'postcss-easy-import': {
3535
onImport: function(imported) {
3636
// Update the watch task with the list of imported files
3737
if (typeof global.watchCSS === 'function') {
@@ -92,12 +92,12 @@ function mergeOptions(options) {
9292

9393
// Set some core options
9494
if (merged.root) {
95-
merged['postcss-import'].root = merged.root;
95+
merged['postcss-easy-import'].root = merged.root;
9696
}
9797

9898
// Call beforeLint function and pass processed css to bem-linter
9999
var beforeLint = merged.beforeLint;
100-
merged['postcss-import'].transform = function(css, filename) {
100+
merged['postcss-easy-import'].transform = function(css, filename) {
101101
if (typeof beforeLint === 'function') {
102102
css = beforeLint(css, filename, merged);
103103
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
"postcss-calc": "^5.0.0",
2727
"postcss-custom-media": "^5.0.0",
2828
"postcss-custom-properties": "^5.0.0",
29+
"postcss-easy-import": "^1.0.1",
2930
"postcss-import": "^8.0.2",
3031
"postcss-reporter": "^1.3.0",
3132
"read-file-stdin": "^0.2.1",
32-
"stylelint": "^5.0.1"
33+
"stylelint": "^5.3.0"
3334
},
3435
"devDependencies": {
3536
"chai": "^3.4.1",

test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('suitcss', function() {
4343
'minify',
4444
'use',
4545
'lint',
46-
'postcss-import',
46+
'postcss-easy-import',
4747
'postcss-reporter',
4848
'cssnano'
4949
];
@@ -55,7 +55,7 @@ describe('suitcss', function() {
5555

5656
it('should allow an import root to be set', function() {
5757
var opts = mergeOptions({root: 'test/root'});
58-
expect(opts['postcss-import'].root).to.equal('test/root');
58+
expect(opts['postcss-easy-import'].root).to.equal('test/root');
5959
});
6060

6161
it('should allow stylelint to be enabled', function() {
@@ -76,15 +76,15 @@ describe('suitcss', function() {
7676
});
7777

7878
expect(opts.use).to.eql([
79-
'postcss-import',
79+
'postcss-easy-import',
8080
'postcss-custom-properties',
8181
'postcss-calc',
8282
'postcss-custom-media',
8383
'autoprefixer',
8484
'postcss-reporter'
8585
]);
8686
expect(opts.autoprefixer).to.eql(autoprefixer);
87-
expect(opts['postcss-import'].root).to.equal('test/root');
87+
expect(opts['postcss-easy-import'].root).to.equal('test/root');
8888
});
8989

9090
describe('passing options to postcss', function() {
@@ -125,7 +125,7 @@ describe('suitcss', function() {
125125
});
126126

127127
expect(opts.use).to.eql([
128-
'postcss-import',
128+
'postcss-easy-import',
129129
'postcss-custom-properties',
130130
'postcss-custom-media',
131131
'autoprefixer',
@@ -141,7 +141,7 @@ describe('suitcss', function() {
141141
});
142142

143143
expect(opts.use).to.eql([
144-
'postcss-import',
144+
'postcss-easy-import',
145145
'postcss-custom-properties',
146146
'postcss-calc',
147147
'postcss-custom-media',

0 commit comments

Comments
 (0)