How to use dotenv-webpack - 2 common examples

To help you get started, we’ve selected a few dotenv-webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iverenshaguy / book-a-meal / webpack.dev.babel.js View on Github external
/* eslint-disable import/no-extraneous-dependencies */
import webpack from 'webpack';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import Dotenv from 'dotenv-webpack';
import merge from 'webpack-merge';

import common from './webpack.common.babel';

const cssPlugin = new MiniCssExtractPlugin({
  filename: '[name].css',
  chunkFilename: '[id].css',
});

const hotReloader = new webpack.HotModuleReplacementPlugin();
const envPlugin = new Dotenv();

export default merge(common, {
  mode: 'development',
  devtool: 'eval-source-map',
  entry: { app: ['react-hot-loader/patch', 'webpack-hot-middleware/client', './client/src/index.jsx'] },
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          'style-loader',
          'css-loader',
          'postcss-loader',
          'sass-loader'
        ]
      }
github ArnoSaine / react-pouchdb / testapp / webpack.config.js View on Github external
export default env => config => {
  const {
    plugins,
    resolve: { alias, modules }
  } = config;

  alias.react = path.resolve('./node_modules/react');

  plugins.push(new Dotenv());

  modules.push('shared');

  return config;
};

dotenv-webpack

A simple webpack plugin to support dotenv.

MIT
Latest version published 9 months ago

Package Health Score

77 / 100
Full package analysis

Popular dotenv-webpack functions