Skip to content

Commit

Permalink
feat: process.env fallback object for browsers usage
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban committed Jan 1, 2019
1 parent 17b83e7 commit f840606
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"no-loop-func": 0,
"new-cap": 0,
"prefer-destructuring": 0,
"block-scoped-var": 0,
"import/no-extraneous-dependencies": [
"error",
{
Expand Down
3 changes: 3 additions & 0 deletions src/define.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import render from './render';
import * as cache from './cache';
import { dispatch, pascalToDash } from './utils';

// eslint-disable-next-line
try { process.env.NODE_ENV } catch(e) { var process = { env: { NODE_ENV: 'production' } }; }

function dispatchInvalidate(host) {
dispatch(host, '@invalidate', { bubbles: true, composed: true });
}
Expand Down
3 changes: 3 additions & 0 deletions src/template/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { dataMap, removeTemplate } from './utils';
import resolveValue from './resolvers/value';
import resolveProperty from './resolvers/property';

// eslint-disable-next-line
try { process.env.NODE_ENV } catch(e) { var process = { env: { NODE_ENV: 'production' } }; }

const TIMESTAMP = Date.now();

export const getPlaceholder = (id = 0) => `{{h-${TIMESTAMP}-${id}}}`;
Expand Down

0 comments on commit f840606

Please # to comment.