Skip to content

Commit 16135df

Browse files
author
Clauderic Demers
committed
fix: replace process.env.NODE_ENV in UMD builds
1 parent db1d3a9 commit 16135df

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"rollup-plugin-commonjs": "^9.2.0",
9898
"rollup-plugin-filesize": "^6.0.0",
9999
"rollup-plugin-node-resolve": "^4.0.0",
100+
"rollup-plugin-replace": "^2.1.0",
100101
"rollup-plugin-uglify": "^6.0.0",
101102
"sass-loader": "^7.1.0",
102103
"standard-version": "^4.4.0",

rollup.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import replace from 'rollup-plugin-replace';
12
import resolve from 'rollup-plugin-node-resolve';
23
import commonjs from 'rollup-plugin-commonjs';
34
import babel from 'rollup-plugin-babel';
@@ -52,6 +53,11 @@ const umdConfig = ({minify} = {}) => ({
5253
targets: {browsers: ['last 2 versions', 'safari >= 7']},
5354
}),
5455
),
56+
replace({
57+
'process.env.NODE_ENV': JSON.stringify(
58+
minify ? 'production' : 'development',
59+
),
60+
}),
5561
commonjs(),
5662
minify && uglify(),
5763
filesize(),

yarn.lock

+22
Original file line numberDiff line numberDiff line change
@@ -4777,6 +4777,11 @@ estree-walker@^0.5.2:
47774777
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39"
47784778
integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==
47794779

4780+
estree-walker@^0.6.0:
4781+
version "0.6.0"
4782+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.0.tgz#5d865327c44a618dde5699f763891ae31f257dae"
4783+
integrity sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==
4784+
47804785
esutils@^2.0.0, esutils@^2.0.2:
47814786
version "2.0.2"
47824787
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -9595,6 +9600,15 @@ rollup-plugin-node-resolve@^4.0.0:
95959600
is-module "^1.0.0"
95969601
resolve "^1.8.1"
95979602

9603+
rollup-plugin-replace@^2.1.0:
9604+
version "2.1.0"
9605+
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz#f9c07a4a89a2f8be912ee54b3f0f68d91e9ed0ae"
9606+
integrity sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ==
9607+
dependencies:
9608+
magic-string "^0.25.1"
9609+
minimatch "^3.0.2"
9610+
rollup-pluginutils "^2.0.1"
9611+
95989612
rollup-plugin-uglify@^6.0.0:
95999613
version "6.0.0"
96009614
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.0.tgz#15aa8919e5cdc63b7cfc9319c781788b40084ce4"
@@ -9605,6 +9619,14 @@ rollup-plugin-uglify@^6.0.0:
96059619
serialize-javascript "^1.5.0"
96069620
uglify-js "^3.4.9"
96079621

9622+
rollup-pluginutils@^2.0.1:
9623+
version "2.4.1"
9624+
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
9625+
integrity sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==
9626+
dependencies:
9627+
estree-walker "^0.6.0"
9628+
micromatch "^3.1.10"
9629+
96089630
rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.3:
96099631
version "2.3.3"
96109632
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"

0 commit comments

Comments
 (0)