Skip to content

Commit

Permalink
Fixup env checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Feb 21, 2019
1 parent bddf388 commit ce8fc89
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 14 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { terser } from 'rollup-plugin-terser';
import rollupReplace from 'rollup-plugin-replace';
import fileSize from 'rollup-plugin-filesize';

const createConfig = ({ input, output }) => ({
const createConfig = ({ input, output, target }) => ({
input,
output,
plugins: [
Expand All @@ -14,11 +14,14 @@ const createConfig = ({ input, output }) => ({
clean: true,
tsconfigOverride: {
compilerOptions: {
declaration: false
declaration: false,
...(target ? { target } : {})
}
}
}),
terser(),
terser({
toplevel: true,
}),
fileSize()
]
});
Expand Down Expand Up @@ -47,5 +50,13 @@ export default [
format: 'umd',
name: 'XStateInterpreter'
}
}),
createConfig({
input: 'src/index.ts',
output: {
file: 'dist/xstate.web.js',
format: 'esm'
},
target: 'ES2015'
})
];
3 changes: 1 addition & 2 deletions src/StateNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ const createDefaultOptions = <TContext>(): MachineOptions<TContext, any> => ({
guards: EMPTY_OBJECT
});

export const IS_PRODUCTION =
typeof process !== 'undefined' ? process.env.NODE_ENV === 'production' : true;
export const IS_PRODUCTION = process.env.NODE_ENV === 'production';

class StateNode<
TContext = DefaultContext,
Expand Down

0 comments on commit ce8fc89

Please sign in to comment.