# dotenv-mix

> Add dotenv-webpack to Laravel Mix

Latest version **1.1.0** (published 2020-07-03) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install dotenv-mix
pnpm add dotenv-mix
yarn add dotenv-mix
bun add dotenv-mix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-07-03 |
| First published | 2020-07-03 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Fenwick |
| Maintainers | jamesfenwick |

## Links

- npm: https://www.npmjs.com/package/dotenv-mix
- Repository: https://github.com/jmsfwk/dotenv-mix
- npm.io page: https://npm.io/package/dotenv-mix

## Dependencies (1)

- [dotenv-webpack](https://npm.io/package/dotenv-webpack.md) ^1.8.0

## Recent versions

- 1.1.0 (latest) — 2020-07-03
- 1.0.3 — 2020-07-03
- 1.0.2 — 2020-07-03
- 1.0.1 — 2020-07-03
- 1.0.0 — 2020-07-03

## README

Add the [`dotenv-webpack`][1] plugin to Laravel Mix to securely add dotenv and other environment variables and only
expose what you use.

<div align="center">
  <h1>
    <img width="30" heigth="30" src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.png" alt="">
    dotenv-mix
  </h1>
</div>

## Installation

`yarn add dotenv-mix`

```js
const mix = require('laravel-mix')
const env = require('dotenv-mix')

// Register with Laravel Mix. You can use any name you want
mix.extend('env', env)

mix.js('resources/js/app.js', 'public/js')
    .env()
```

## Usage

Once the component has been added to Mix no configuration is required. The `.env` file will be used by default.

To use a different file pass the path as the first argument to `.env()`. 

```js
mix.env('.env.mix')
```
An options object can be passed as the second argument. This supports all the same [options][2] as `dotenv-webpack`
(except `path`). 

[1]: https://github.com/mrsteele/dotenv-webpack
[2]: https://github.com/mrsteele/dotenv-webpack#properties

---
_Source: https://npm.io/package/dotenv-mix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
