Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
fixup after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 17, 2020
1 parent ccd36fb commit f12b58c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"path": "dist/esm/index.js",
"limit": "15 KB"
},
{
"name": "createPureApi + setupListeners",
"path": "dist/esm/index.js",
"import": "{ createPureApi, setupListeners }"
},
{
"name": "createApi + setupListeners",
"path": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import replace from '@rollup/plugin-replace';
/** @type {import("rollup").RollupOptions} */
const defaultConfig = {
input: 'src/index.ts',
external: [/@babel\/runtime/, /@reduxjs\/toolkit/, /react/, /react-redux/, /immer/, /tslib/],
external: [/@babel\/runtime/, /@reduxjs\/toolkit/, /react$/, /react-redux/, /immer/, /tslib/],
treeshake: {
propertyReadSideEffects: false,
},
Expand Down
3 changes: 1 addition & 2 deletions src/core/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { buildMiddleware } from './buildMiddleware';
import { buildSelectors } from './buildSelectors';
import { buildInitiate } from './buildInitiate';
import { assertCast, Id, safeAssign } from '../tsHelpers';
import { IS_DEV } from '../utils';
import { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';
import { SliceActions } from './buildSlice';
import { BaseQueryFn } from '../baseQueryTypes';
Expand Down Expand Up @@ -114,7 +113,7 @@ export const coreModule: Module<CoreModule> = {
assertCast<InternalSerializeQueryArgs<any>>(serializeQueryArgs);

const assertEntityType: AssertEntityTypes = (entity) => {
if (IS_DEV()) {
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {
if (!entityTypes.includes(entity.type as any)) {
console.error(`Entity type '${entity.type}' was used, but not specified in \`entityTypes\`!`);
}
Expand Down
3 changes: 1 addition & 2 deletions src/createApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Api, Module, ModuleName } from './apiTypes';
import type { BaseQueryArg, BaseQueryFn } from './baseQueryTypes';
import { defaultSerializeQueryArgs, SerializeQueryArgs } from './defaultSerializeQueryArgs';
import { DefinitionType, EndpointBuilder, EndpointDefinitions } from './endpointDefinitions';
import { IS_DEV } from './utils';

export interface CreateApiOptions<
BaseQuery extends BaseQueryFn,
Expand Down Expand Up @@ -62,7 +61,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
});

for (const [endpoint, definition] of Object.entries(evaluatedEndpoints)) {
if (IS_DEV()) {
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {
if (!inject.overrideExisting && endpoint in context.endpointDefinitions) {
console.error(
`called \`injectEndpoints\` to override already-existing endpoint ${endpoint} without specifying \`overrideExisting: true\``
Expand Down

0 comments on commit f12b58c

Please sign in to comment.