Created
November 26, 2017 10:04
-
-
Save mauricedb/f750f8765a5709c440f04ee10d04283f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const ManifestPlugin = require("webpack-manifest-plugin"); | |
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin"); | |
const config = require("react-scripts/config/webpack.config.prod"); | |
config.entry = "./src/index.ssr.js"; | |
config.output.filename = "static/ssr/[name].js"; | |
config.output.libraryTarget = "commonjs2"; | |
delete config.output.chunkFilename; | |
config.target = "node"; | |
config.externals = /^[a-z\-0-9]+$/; | |
delete config.devtool; | |
config.plugins = config.plugins.filter( | |
plugin => | |
!( | |
plugin instanceof HtmlWebpackPlugin || | |
plugin instanceof ManifestPlugin || | |
plugin instanceof SWPrecacheWebpackPlugin | |
) | |
); | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment