Skip to content

Commit 5d164b5

Browse files
authored
Merge pull request #69 from gdelmas/add-loader-plugins-option
Add loaderPlugin option
2 parents 3562166 + fdfd178 commit 5d164b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"node": ">=8.0.0"
2929
},
3030
"dependencies": {
31+
"@types/css-modules-loader-core": "^1.1.0",
3132
"camelcase": "^5.3.1",
3233
"chalk": "^2.1.0",
3334
"chokidar": "^2.1.2",
@@ -38,7 +39,6 @@
3839
"yargs": "^8.0.2"
3940
},
4041
"devDependencies": {
41-
"@types/css-modules-loader-core": "^1.1.0",
4242
"@types/glob": "^7.1.1",
4343
"@types/mkdirp": "^0.5.1",
4444
"@types/node": "^12.0.3",

src/DtsCreator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as os from 'os';
44
import camelcase from "camelcase"
55
import FileSystemLoader from './FileSystemLoader';
66
import {DtsContent} from "./DtsContent";
7+
import {Plugin} from "postcss";
78

89

910
type CamelCaseOption = boolean | 'dashes' | undefined;
@@ -15,6 +16,7 @@ interface DtsCreatorOptions {
1516
camelCase?: CamelCaseOption;
1617
dropExtension?: boolean;
1718
EOL?: string;
19+
loaderPlugins?: Plugin<any>[];
1820
}
1921

2022
export class DtsCreator {
@@ -33,7 +35,7 @@ export class DtsCreator {
3335
this.rootDir = options.rootDir || process.cwd();
3436
this.searchDir = options.searchDir || '';
3537
this.outDir = options.outDir || this.searchDir;
36-
this.loader = new FileSystemLoader(this.rootDir);
38+
this.loader = new FileSystemLoader(this.rootDir, options.loaderPlugins);
3739
this.inputDirectory = path.join(this.rootDir, this.searchDir);
3840
this.outputDirectory = path.join(this.rootDir, this.outDir);
3941
this.camelCase = options.camelCase;

0 commit comments

Comments
 (0)