Skip to content

Commit c3c22f8

Browse files
fix: add TS declarations (#282)
1 parent 0177e45 commit c3c22f8

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

index.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
declare module 'extract-css-chunks-webpack-plugin' {
2+
import { ChunkData, Loader, Plugin } from 'webpack';
3+
4+
class ExtractCssChunksPlugin extends Plugin {
5+
static loader: Loader;
6+
7+
constructor(options?: ExtractCssChunksPlugin.PluginOptions);
8+
}
9+
10+
namespace ExtractCssChunksPlugin {
11+
interface PluginOptions {
12+
/**
13+
* The filename of the entry chunk.
14+
*/
15+
filename?: string;
16+
/**
17+
* The filename of non-entry chunks.
18+
*/
19+
chunkFilename?: string;
20+
/**
21+
* Generates a file name (or template) based on chunk data.
22+
*/
23+
moduleFilename?: (chunk: ChunkData) => string;
24+
/**
25+
* Remove warnings about conflicting order.
26+
*/
27+
ignoreOrder?: boolean;
28+
/**
29+
* Inserts `<link>` at the given position (https://github.com/faceyspacey/extract-css-chunks-webpack-pluginn#insert).
30+
*/
31+
insert?: string | Function;
32+
}
33+
}
34+
35+
export = ExtractCssChunksPlugin;
36+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"extract-css-chunks-webpack-plugin"
3232
],
3333
"main": "dist/cjs.js",
34+
"types": "index.d.ts",
3435
"engines": {
3536
"node": ">= 6.9.0"
3637
},
@@ -59,7 +60,8 @@
5960
"travis": "npm run ci:coverage"
6061
},
6162
"files": [
62-
"dist"
63+
"dist",
64+
"index.d.ts"
6365
],
6466
"peerDependencies": {
6567
"webpack": "^4.4.0 || ^5.0.0"

0 commit comments

Comments
 (0)