UNPKG

html-render-webpack-plugin

Version:

webpack plugin for rendering static HTML in a multi-config webpack build

29 lines (26 loc) 703 B
const path = require("path"); const HtmlRenderPlugin = require("../../../src").default; const renderDirectory = path.join(process.cwd(), "dist", "render"); const srcPath = path.resolve(__dirname, "./src"); const paths = { renderEntry: path.resolve(srcPath, "render.js"), clientEntry: path.resolve(srcPath, "client.js"), }; module.exports = { name: "render", target: "node", mode: "production", entry: paths.renderEntry, output: { libraryExport: "default", library: "static", libraryTarget: "umd2", filename: "render-[name]-[contenthash].js", }, plugins: [ new HtmlRenderPlugin({ mapStatsToParams: () => ({}), renderDirectory, }).render(), ], };