mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
[webpack-dotenv-plugin] Add type definitions (#18726)
This commit is contained in:
committed by
Mohamed Hegazy
parent
86e4c7565c
commit
7935e187c6
22
types/webpack-dotenv-plugin/index.d.ts
vendored
Normal file
22
types/webpack-dotenv-plugin/index.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Type definitions for webpack-dotenv-plugin 2.0
|
||||
// Project: https://github.com/nwinch/webpack-dotenv-plugin#readme
|
||||
// Definitions by: Michael Strobel <https://github.com/kryops>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as webpack from 'webpack';
|
||||
|
||||
declare namespace WebpackDotenvPlugin {
|
||||
interface Options {
|
||||
path?: string;
|
||||
sample?: string;
|
||||
silent?: boolean;
|
||||
encoding?: string;
|
||||
allowEmptyValues?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare class WebpackDotenvPlugin extends webpack.Plugin {
|
||||
constructor(options?: WebpackDotenvPlugin.Options);
|
||||
}
|
||||
|
||||
export = WebpackDotenvPlugin;
|
||||
22
types/webpack-dotenv-plugin/tsconfig.json
Normal file
22
types/webpack-dotenv-plugin/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpack-dotenv-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/webpack-dotenv-plugin/tslint.json
Normal file
1
types/webpack-dotenv-plugin/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
19
types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts
Normal file
19
types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as webpack from 'webpack';
|
||||
import * as DotenvPlugin from 'webpack-dotenv-plugin';
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
plugins: [
|
||||
new DotenvPlugin(),
|
||||
new DotenvPlugin({
|
||||
sample: './.env.default',
|
||||
path: './.env'
|
||||
}),
|
||||
new DotenvPlugin({
|
||||
sample: './.env.default',
|
||||
path: './.env',
|
||||
silent: true,
|
||||
encoding: 'utf-8',
|
||||
allowEmptyValues: true
|
||||
})
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user