Skip to content

Commit

Permalink
guard Debug Panel with process.env.NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolodavis committed Oct 23, 2019
1 parent 1e1c7fa commit 83810ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const minifiedPlugins = [
svelte({ extensions: ['.svelte'] }),
commonjs(),
replace({
exclude: 'src/**',
'process.env.NODE_ENV': JSON.stringify('production'),
}),
filesize(),
Expand Down
6 changes: 5 additions & 1 deletion src/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ class _ClientImpl {
}

mount() {
if (this.debug !== false && this._debugPanel == null) {
if (
process.env.NODE_ENV !== 'production' &&
this.debug !== false &&
this._debugPanel == null
) {
let target = document.body;
if (this.debug && this.debug.target) {
target = this.debug.target;
Expand Down

0 comments on commit 83810ea

Please sign in to comment.