IMPORTANT: Do NOT do this if you didn't use 2.x alphas of react-scripts
.
Inside any created project that has not been ejected, run:
$ npm install --save --save-exact [email protected]
$ # or
$ yarn add --exact [email protected]
After running this command, follow the instructions for migrating from 1.1.15 to 2.0.3. Then proceed to the migration steps below.
Monorepo support was half-baked and didn't account for many cases, so we decided to remove it. We know this is frustrating for people relying on it, but it was blocking the release and we didn't really have a solution that would work well in longer term. This is something we still want to do in the future, but we don't have a comprehensive proposal for this yet.
We're sorry that there's no easy way to migrate this, but it can be done:
For Application Logic
Importing application code should just work, provided it does not contain any JSX.
For Components
Importing uncompiled components (any file that contains JSX) will not work. You will need to compile these packages using something like nwb
. Be sure your package.json
main
and module
keys point to the compiled code and not the source code.
We removed explicit support for importing .graphql
files in favor of a Babel Macro.
Install graphql.macro
and migrate your existing .graphql
imports to look like this:
import { loader as gqlLoader } from 'graphql.macro';
const query = gqlLoader('./query.graphql');
Remove the browserslist
key from package.json
and you will be prompted to accept the new defaults next time you run the development server or a build.
This was a large release, and we might have missed something.
Please file an issue and we will try to help.
@marcinzenko just because it had some rough edges which you seemed to bump into, it's not so cool to see this awesome feature go, especially when relying big projects on it. An improvement to resolve your issue would've been a lot better.