Skip to content
Permalink
Browse files

addded .env and webpack-dotenv for secrets (see .env.sample)

  • Loading branch information...
gnowland committed Nov 20, 2018
1 parent 318f162 commit 093f34e919c6dd5400b8c68b66ac8c899331e813
Showing with 24 additions and 1 deletion.
  1. +3 −0 .env.sample
  2. +2 −0 .gitignore
  3. +2 −1 README.md
  4. +1 −0 package.json
  5. +4 −0 webpack.config.js
  6. +12 −0 yarn.lock
@@ -0,0 +1,3 @@
# Secrets
API_USER="example@example.com"
API_KEY="long-string-of-random-characters"
@@ -77,3 +77,5 @@ lib
.history
icons.json
env-utilities/bin

.env
@@ -10,7 +10,8 @@ This project uses **yarn**, **webpack** and **browsersync**.
* JS build processes are defined in `webpack.config.js` (webpack)
* Source files (raw files that must be compiled before being used with other systems) are located in `/src`.
* Compiled files (js, css -- files that are packaged and ready to be used with other systems) are output to `/dist` by **webpack** & **yarn** build processes (see below). *These files should not be modified directly, they will be overwritten on the next compile!*
* A boilerplate main.js, app.js, and index.html are also included.
* Environmentally specific and sensitive information is stored in a `.env` file in the project root. Rename `.env.sample` to `.env` and enter your API key information, etc. before compiling.


### How it works

@@ -33,6 +33,7 @@
"browser-sync": "^2.26.3",
"clean-css-cli": "^4.2.1",
"css-mqpacker": "^7.0.0",
"dotenv-webpack": "^1.5.7",
"eslint": "^5.9.0",
"eslint-config-defaults": "^9.0.0",
"eslint-plugin-import": "^2.14.0",
@@ -1,6 +1,7 @@
/* global module process */

let devToolType = process.env.NODE_ENV === 'dev' ? 'cheap-eval-source-map' : '';
const Dotenv = require('dotenv-webpack');

module.exports = {
entry: './src/js/main.js',
@@ -21,5 +22,8 @@ module.exports = {
}
]
},
plugins: [
new Dotenv()
],
devtool: devToolType
};
@@ -2127,6 +2127,18 @@ dot-prop@^4.1.1:
dependencies:
is-obj "^1.0.0"

dotenv-webpack@^1.5.7:
version "1.5.7"
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.5.7.tgz#c44395ab21d1fd28d79a90942a7b14b1debd145f"
integrity sha1-xEOVqyHR/SjXmpCUKnsUsd69FF8=
dependencies:
dotenv "^5.0.1"

dotenv@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==

duplexer@^0.1.1, duplexer@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"

0 comments on commit 093f34e

Please sign in to comment.
You can’t perform that action at this time.