🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@mahpooya/dotenv-mix

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mahpooya/dotenv-mix

Add dotenv-webpack to Laravel Mix (Fork for update dependencies)

latest
Source
npmnpm
Version
1.1.11
Version published
Maintainers
1
Created
Source

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

@mahpooya/dotenv-mix

Installation

npm install @mahpooya/dotenv-mix --save-dev

yarn add @mahpooya/dotenv-mix

const mix = require('@mahpooya/laravel-mix')
const env = require('@mahpooya/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().

mix.env('.env.mix')

An options object can be passed as the second argument. This supports all the same options as dotenv-webpack (except path).

Keywords

dotenv-mix

FAQs

Package last updated on 19 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts