{ "info": { "author": "Oliver Epper", "author_email": "oliver.epper@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Plugins", "Framework :: Lektor" ], "description": "# lektor-webpack-html-helper\n\nThis is a plugin for Lektor that adds support for generating templates with webpacks HtmlWebpackPlugin. These templates can be generated into Lektors assets folder which will be observed for newly created or modified html files.\nThese files will then be copied over to Lektors templates folder so that they can be used by Lektor.\nThis plugin depends on the [lektor-webpack-support](https://github.com/lektor/lektor-webpack-support) plugin to be really useful.\n\n# webpack/webpack.config.js\n```js\nconst path = require(\"path\");\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\nconst { CleanWebpackPlugin } = require(\"clean-webpack-plugin\");\n\n\nmodule.exports = {\n mode: \"production\",\n entry: {\n main: \"./src/index.js\"\n },\n output: {\n filename: \"[name].bundle.js\",\n path: path.dirname(__dirname) + \"/assets/generated\" \n },\n optimization: {\n minimizer: [\n new HtmlWebpackPlugin({\n inject: false,\n filename: \"layout_generated.html\",\n template: \"./src/layout_template.html\"\n })\n ],\n },\n plugins: [\n new CleanWebpackPlugin(),\n new MiniCssExtractPlugin({\n filename: \"[name].css\"\n })\n ],\n module: {\n rules: [{\n test: /\\.scss$/,\n use: [\n MiniCssExtractPlugin.loader,\n \"css-loader\",\n \"sass-loader\"\n ]\n }]\n }\n}\n```\n\n# webpack/src/layout_template.html\n```html\n\n\n\n
\n \n \n \n