Files
web2.0-frontend/configs/webpack/prod.js
T
2018-07-03 12:08:02 +03:00

51 lines
1.4 KiB
JavaScript

// Production config
const path = require("path");
const merge = require("webpack-merge");
const resolve = path.resolve;
const DynamicCdnWebpackPlugin = require("dynamic-cdn-webpack-plugin");
const PrerenderSPAPlugin = require("prerender-spa-plugin");
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
/* NOTE: This is a list of all routes that are prerendered for production use.
Please list all routes that contain search engine accessible content, i.e.,
stuff that you would like to find with a Google Search. */
const PRERENDERED_ROUTES = ["/", "/404"];
const commonConfig = require("./common");
module.exports = merge(commonConfig, {
mode: "production",
entry: "./index.tsx",
output: {
filename: "js/bundle.[hash].min.js",
path: resolve(__dirname, "../../dist"),
publicPath: "/"
},
devtool: "source-map",
plugins: [
new FaviconsWebpackPlugin({
logo: "./assets/img/favicon.png",
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: true,
favicons: true,
firefox: true,
opengraph: true,
twitter: true,
yandex: true,
windows: true
}
}),
new DynamicCdnWebpackPlugin(),
new PrerenderSPAPlugin({
// Required - The path to the webpack-outputted app to prerender.
staticDir: resolve(__dirname, "../../dist"),
// Required - Routes to render.
routes: PRERENDERED_ROUTES
})
]
});