Skip to content

Commit

Permalink
fix: replace process.env.NODE_ENV in UMD builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Clauderic Demers committed Mar 13, 2019
1 parent db1d3a9 commit 16135df
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-filesize": "^6.0.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-uglify": "^6.0.0",
"sass-loader": "^7.1.0",
"standard-version": "^4.4.0",
Expand Down
6 changes: 6 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
Expand Down Expand Up @@ -52,6 +53,11 @@ const umdConfig = ({minify} = {}) => ({
targets: {browsers: ['last 2 versions', 'safari >= 7']},
}),
),
replace({
'process.env.NODE_ENV': JSON.stringify(
minify ? 'production' : 'development',
),
}),
commonjs(),
minify && uglify(),
filesize(),
Expand Down
22 changes: 22 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4777,6 +4777,11 @@ estree-walker@^0.5.2:
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39"
integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==

estree-walker@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.0.tgz#5d865327c44a618dde5699f763891ae31f257dae"
integrity sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==

esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
Expand Down Expand Up @@ -9595,6 +9600,15 @@ rollup-plugin-node-resolve@^4.0.0:
is-module "^1.0.0"
resolve "^1.8.1"

rollup-plugin-replace@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz#f9c07a4a89a2f8be912ee54b3f0f68d91e9ed0ae"
integrity sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ==
dependencies:
magic-string "^0.25.1"
minimatch "^3.0.2"
rollup-pluginutils "^2.0.1"

rollup-plugin-uglify@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.0.tgz#15aa8919e5cdc63b7cfc9319c781788b40084ce4"
Expand All @@ -9605,6 +9619,14 @@ rollup-plugin-uglify@^6.0.0:
serialize-javascript "^1.5.0"
uglify-js "^3.4.9"

rollup-pluginutils@^2.0.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
integrity sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==
dependencies:
estree-walker "^0.6.0"
micromatch "^3.1.10"

rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
Expand Down

0 comments on commit 16135df

Please sign in to comment.