Skip to content

v0.1.40

Choose a tag to compare

@samselikoff samselikoff released this 22 May 13:07
· 216 commits to master since this release
2ecdcb4

🚀 Enhancements

  • #481 Mark Mirage as tree-shakable via sideEffects key.

    Prior to this change, Webpack (in common tools like Create React App + Vue CLI) would not tree-shake Mirage from production builds, since Mirage does indeed have side effects. However, these side effects are only relevant during development, and should not prevent Mirage from being tree-shaken from production builds.

    The sideEffects key is an escape hatch and can be used to tell Webpack exactly this. With this change, apps with modern build setups that use Mirage like this

    import { Server } from 'miragejs'
    
    if (process.env.NODE_ENV !== 'production') {
      new Server()
    }

    should get all of miragejs automatically tree-shaken from their production builds!

🏠 Internal

  • Dependency updates