Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You are currently using minified code outside of NODE_ENV === "production". #68

Closed
OrzX opened this issue Jan 4, 2019 · 5 comments
Closed

Comments

@OrzX
Copy link

OrzX commented Jan 4, 2019

When I use redux-starter-kit with webpack in production mode, keep telling me this:
This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.

I didn't find any file names like "*.min.js" under /node_modules/redux-starter-kit/dist/

@markerikson
Copy link
Collaborator

Hmm. It's possible we have our lib build settings wrong.

Can you create a small project that reproduces the issue?

@OrzX
Copy link
Author

OrzX commented Jan 4, 2019

$ create-react-app hello-redux
$ cd hello-redux
$ npm install --save redux-starter-kit

then add the code blew in /src/index.js

import { getDefaultMiddleware } from 'redux-starter-kit';
// make sure the lib is imported.
const defaultMiddleware = getDefaultMiddleware();
$ npm run build

No we can see the warning message:

$ npm install -g serve
$ serve -s build

open http://localhost:5000/, the warning message should be displayed in the console output

@markerikson
Copy link
Collaborator

markerikson commented Jan 11, 2019

Hmm. Looking at the sourcemap, it kinda seems like it's maybe using the UMD build instead of the CommonJS or ESM builds.

Our package.json currently says:

  "main": "dist/redux-starter-kit.cjs.js",
  "module": "dist/redux-starter-kit.esm.js",
  "browser": "dist/redux-starter-kit.umd.js",

I don't know enough about those fields to understand the differences.

@markerikson
Copy link
Collaborator

Aha. This look like it's sort of a dupe of #55 .

@markerikson
Copy link
Collaborator

This should be resolved in https://github.com/reduxjs/redux-starter-kit/releases/tag/v0.3.2 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants