Skip to content

Commit 36eeb41

Browse files
committed
remove node 6 support
This reverts commit 7d4049f and disables running tests in travis on node 6 and specifies engine support in package.json
1 parent 7d4049f commit 36eeb41

File tree

5 files changed

+13
-33
lines changed

5 files changed

+13
-33
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ env:
66
- GIT_AUTHOR_EMAIL=yosuke.kurami@gmail.com
77
language: node_js
88
node_js:
9-
- 6
109
- 8
1110
- 9
1211
before_script:

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
],
2525
"author": "quramy",
2626
"license": "MIT",
27+
"engines": {
28+
"node": ">=8.0.0"
29+
},
2730
"dependencies": {
2831
"camelcase": "^5.3.1",
2932
"chalk": "^2.1.0",

src/DtsContent.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import * as fs from "fs";
12
import * as os from "os";
23
import * as path from "path";
34
import isThere from "is-there";
45
import * as mkdirp from 'mkdirp';
5-
import {writeFile} from "./fs";
6+
import * as util from "util";
7+
8+
const writeFile = util.promisify(fs.writeFile);
69

710

811
interface DtsContentOptions {
@@ -71,7 +74,7 @@ export class DtsContent {
7174
mkdirp.sync(outPathDir);
7275
}
7376

74-
await writeFile(this.outputFilePath, this.formatted);
77+
await writeFile(this.outputFilePath, this.formatted, 'utf8');
7578
}
7679
}
7780

src/FileSystemLoader.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
/* this file is forked from https://raw.githubusercontent.com/css-modules/css-modules-loader-core/master/src/file-system-loader.js */
22

33
import Core from 'css-modules-loader-core'
4+
import * as fs from 'fs'
45
import * as path from 'path'
6+
import * as util from 'util'
57
import { Plugin } from "postcss";
6-
import {readFile} from "./fs";
78

89

910
type Dictionary<T> = {
1011
[key: string]: T | undefined;
1112
};
1213

14+
const readFile = util.promisify(fs.readFile);
15+
1316

1417
export default class FileSystemLoader {
1518
private root: string;
@@ -51,7 +54,7 @@ export default class FileSystemLoader {
5154
}
5255

5356
try {
54-
source = await readFile(fileRelativePath);
57+
source = await readFile(fileRelativePath, "utf-8");
5558
}
5659
catch (error) {
5760
if (relativeTo && relativeTo !== '/') {

src/fs.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)