Skip to content

v0.4.0

Compare
Choose a tag to compare
@gaearon gaearon released this 02 Sep 21:13

0.4.0 (September 2, 2016)

Build Dependency (react-scripts)

  • Breaking Change: Disabled implicit serving of source files in development. (@gaearon in #551)
  • You can use NODE_PATH environment variable for absolute import paths. (@jimmyhmiller in #476)
  • If src/setupTests.js exists, it will be used to setup the test environment. (@gaelduplessix in #548)
  • If HTTPS environment variable is set to true, development server will run in HTTPS mode. (@dceddia in #552)

Migrating from 0.3.1 to 0.4.0

Inside any created project that has not been ejected, run:

npm install --save-dev --save-exact react-scripts@0.4.0

Breaking Change in 0.4.0

Paths like /src/somefile.png used to be served in development, but only by accident. They never worked in production builds. Since 0.4.0, we don’t serve static files by default in development anymore either. This removes a dangerous inconsistency that we never intentionally supported.

If you need a static file to be part for the build, import it from JavaScript and you will get its filename. This ensures it gets included into the production build as well, and its filename contains the content hash.

If you used static files with <link href>, read this new guide on how to make sure these files get included into the builds. For example, you can replace <link href="/src/favicons/favicon-32.png"> with <link href="./src/favicons/favicon-32.png">, and then Webpack will recognize it and include it into the build.

If you referenced some other files from index.html, please file an issue to discuss your use case. In the meantime, you can serve them from a separate static server until your use case is supported.