Skip to content

Commit f1bb53f

Browse files
committed
Switch to postcss-easy-import
This is just a thin wrapper around postcss-import that allows additional options
1 parent 777940c commit f1bb53f

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

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)