mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[dotenv-webpack] Update types for v1.7.0
This commit is contained in:
@@ -3,19 +3,27 @@ import DotenvWebpackPlugin = require('dotenv-webpack');
|
||||
|
||||
new DotenvWebpackPlugin(); // $ExpectType DotenvWebpackPlugin
|
||||
|
||||
const options: DotenvWebpackPlugin.Options = {
|
||||
const optionsEmpty: DotenvWebpackPlugin.Options = {};
|
||||
|
||||
const optionsFull: DotenvWebpackPlugin.Options = {
|
||||
path: './some.other.env',
|
||||
safe: true,
|
||||
systemvars: true,
|
||||
silent: true
|
||||
silent: true,
|
||||
expand: true,
|
||||
defaults: true
|
||||
};
|
||||
|
||||
const optionsStrings: DotenvWebpackPlugin.Options = {
|
||||
safe: './some.other.env.example',
|
||||
defaults: './some.other.env.defaults'
|
||||
};
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
plugins: [
|
||||
new DotenvWebpackPlugin(),
|
||||
new DotenvWebpackPlugin({
|
||||
path: './some.other.env',
|
||||
}),
|
||||
new DotenvWebpackPlugin(options),
|
||||
new DotenvWebpackPlugin(optionsEmpty),
|
||||
new DotenvWebpackPlugin(optionsFull),
|
||||
new DotenvWebpackPlugin(optionsStrings)
|
||||
]
|
||||
};
|
||||
|
||||
16
types/dotenv-webpack/index.d.ts
vendored
16
types/dotenv-webpack/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for dotenv-webpack 1.5
|
||||
// Type definitions for dotenv-webpack 1.7
|
||||
// Project: https://github.com/mrsteele/dotenv-webpack
|
||||
// Definitions by: Karol Majewski <https://github.com/karol-majewski>
|
||||
// Dave Cardwell <https://github.com/davecardwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
@@ -20,7 +21,7 @@ declare namespace DotenvWebpackPlugin {
|
||||
/**
|
||||
* If `false` ignore safe-mode, if `true` load `'./.env.example'`, if a `string` load that file as the sample. Default: `false`.
|
||||
*/
|
||||
safe?: boolean;
|
||||
safe?: boolean | string;
|
||||
|
||||
/**
|
||||
* Set to `true` if you would rather load all system variables as well (useful for CI purposes). Default: `false`.
|
||||
@@ -31,6 +32,17 @@ declare namespace DotenvWebpackPlugin {
|
||||
* If `true`, all warnings will be surpressed. Default: `false`.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* Allows your variables to be "expanded" for reusability within your .env file. Default: `false`.
|
||||
*/
|
||||
expand?: boolean;
|
||||
|
||||
/**
|
||||
* Adds support for dotenv-defaults. If set to `true`, uses `./.env.defaults`. If a `string`, uses that location for a defaults file.
|
||||
* Read more at https://www.npmjs.com/package/dotenv-defaults. Default: `false`.
|
||||
*/
|
||||
defaults?: boolean | string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user