Last active
March 5, 2018 18:34
-
-
Save avivshafir/8379dcad77d239ddccc66897a724a8bf to your computer and use it in GitHub Desktop.
webpack 4 loading vendors into vendor.js and generating a manifest file which includes the webpack runtime
This file contains 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
mode: "production", | |
entry: { | |
app: path.join(__dirname, "index.tsx"), | |
}, | |
output: { | |
path: path.resolve(__dirname, "public/dist"), | |
publicPath: "", | |
chunkFilename: "[name].js", | |
filename: "[name].js" | |
}, | |
optimization: { | |
runtimeChunk: { | |
name: "manifest" | |
}, | |
splitChunks: { | |
cacheGroups: { | |
vendor: { | |
test: /[\\/]node_modules[\\/]/, | |
name: "vendors", | |
priority: -20, | |
chunks: "all" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment