DefinitelyTyped/types/dotenv-webpack/dotenv-webpack-tests.ts
Piotr Błażejewicz (Peter Blazejewicz) ccebb665b7
🤖 Merge PR #47789 update(dotenv-webpack): version 3 and minor changes by @peterblazejewicz
- version 3 is breaking (not on the shape of the api though):
https://github.com/mrsteele/dotenv-webpack/releases/tag/v3.0.0
- minor JSDoc refinements
- minor code corrections to align with package README

Thanks!
2020-09-19 13:05:43 -07:00

32 lines
699 B
TypeScript

import * as webpack from 'webpack';
import Dotenv = require('dotenv-webpack');
import { Options } from 'dotenv-webpack';
new Dotenv(); // $ExpectType DotenvWebpackPlugin
const optionsEmpty: Options = {};
const optionsFull: Options = {
path: './some.other.env',
safe: true,
allowEmptyValues: true,
systemvars: true,
silent: true,
expand: true,
defaults: true
};
const optionsStrings: Options = {
safe: './some.other.env.example',
defaults: './some.other.env.defaults'
};
const config: webpack.Configuration = {
plugins: [
new Dotenv(),
new Dotenv(optionsEmpty),
new Dotenv(optionsFull),
new Dotenv(optionsStrings)
]
};