A compiler that makes your life easier if you are building isomorphic webpack powered apps, that is, single page applications with server-side rendering
A compiler that makes your life easier if you are building isomorphic webpack powered apps, that is, single page applications with server-side rendering.
The current version works with webpack v2, v3 and v4.
Motivation
With webpack, client-side applications with server-side rendering means compiling both the client and the server.
To make it right, the client and server compilers must be in sync and live in perfect harmony.
Webpack offers a multi-compiler that makes this possible, but unfortunately it doesn't have all the plugin handlers that a single compiler does. This makes it difficult to know what's happening under the hood.
NOTE: While webpack-sane-compiler-reporter is compatible with this compiler, we advise using webpack-isomorphic-compiler-reporter instead for completeness and accurateness.
The returned compiler has exactly the same API as the webpack-sane-compiler but adds some functionality that is detailed below.
Compilation result
The compilation result, available through .run(), .watch(), .getCompilation() and .resolve(), has two more properties:
compiler.run().then(({ clientStats, serverStats, stats, duration }) => { // clientStats is the webpack stats of the client // serverStats is the webpack stats of the client // duration is the aggregated compilation duration // stats maps to clientStats for API compatibility})
Client & server webpack
Both client and server properties contain their webpack configs & compilers.