mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add types for write-file-webpack-plugin (#45374)
This commit is contained in:
parent
feb6196347
commit
2252c4f5cb
43
types/write-file-webpack-plugin/index.d.ts
vendored
Normal file
43
types/write-file-webpack-plugin/index.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
// Type definitions for write-file-webpack-plugin 4.5
|
||||
// Project: https://github.com/gajus/write-file-webpack-plugin#readme
|
||||
// Definitions by: Nathan Hardy <https://github.com/nhardy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import webpack = require("webpack");
|
||||
|
||||
export interface UserOptionsType {
|
||||
/**
|
||||
* Atomically replace files content (i.e., to prevent programs like test watchers from seeing partial files).
|
||||
* @default true
|
||||
*/
|
||||
atomicReplace?: boolean;
|
||||
/**
|
||||
* Stop writing files on webpack errors
|
||||
* @default true
|
||||
*/
|
||||
exitOnErrors?: boolean;
|
||||
/**
|
||||
* A regular expression or function used to test if file should be written.
|
||||
* When not present, all bundle will be written.
|
||||
*/
|
||||
test?: RegExp;
|
||||
/**
|
||||
* Use hash index to write only files that have changed since the last iteration.
|
||||
* @default true
|
||||
*/
|
||||
useHashIndex?: boolean;
|
||||
/**
|
||||
* Logs names of the files that are being written (or skipped because they have not changed)
|
||||
* @default true
|
||||
*/
|
||||
log?: boolean;
|
||||
/**
|
||||
* Forces the execution of the plugin regardless of being using `webpack-dev-server` or not
|
||||
* @default false
|
||||
*/
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
export default class WriteFilePlugin extends webpack.Plugin {
|
||||
constructor(userOptions?: UserOptionsType);
|
||||
}
|
||||
23
types/write-file-webpack-plugin/tsconfig.json
Normal file
23
types/write-file-webpack-plugin/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"write-file-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/write-file-webpack-plugin/tslint.json
Normal file
1
types/write-file-webpack-plugin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -0,0 +1,15 @@
|
||||
import webpack = require("webpack");
|
||||
import WriteFileWebpackPlugin from "write-file-webpack-plugin";
|
||||
|
||||
export const plugins: webpack.Plugin[] = [
|
||||
new WriteFileWebpackPlugin(),
|
||||
new WriteFileWebpackPlugin({}),
|
||||
new WriteFileWebpackPlugin({
|
||||
atomicReplace: false,
|
||||
exitOnErrors: false,
|
||||
test: /\.css$/,
|
||||
useHashIndex: false,
|
||||
log: false,
|
||||
force: true,
|
||||
}),
|
||||
];
|
||||
Loading…
Reference in New Issue
Block a user