Skip to content

Commit 43868a5

Browse files
committed
use promise-polyfill so it still works in older versions of node
1 parent aafa521 commit 43868a5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Some css-modules-loader-code dependencies use Promise so we'll provide it for older node versions
2+
if (!global.Promise) { global.Promise = require('promise-polyfill') }
3+
14
var fs = require('fs');
25
var path = require('path');
36
var through = require('through');
@@ -6,7 +9,6 @@ var FileSystemLoader = require('css-modules-loader-core/lib/file-system-loader')
69
var assign = require('object-assign');
710
var stringHash = require('string-hash');
811

9-
1012
/*
1113
Custom `generateScopedName` function for `postcss-modules-scope`.
1214
Short names consisting of source hash and line number.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "index.js",
66
"dependencies": {
77
"css-modules-loader-core": "^1.0.0-beta4",
8+
"promise-polyfill": "^2.1.0",
89
"object-assign": "^3.0.0",
910
"string-hash": "^1.1.0",
1011
"through": "^2.3.7"

0 commit comments

Comments
 (0)