{"id":16580825,"url":"https://github.com/zhex/page-webpack-plugin","last_synced_at":"2025-06-25T17:04:57.498Z","repository":{"id":65370602,"uuid":"47965529","full_name":"zhex/page-webpack-plugin","owner":"zhex","description":"replace assets in webpages with compiled asset path","archived":false,"fork":false,"pushed_at":"2017-05-09T09:32:44.000Z","size":12,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T22:43:52.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-14T09:41:22.000Z","updated_at":"2016-03-24T10:35:36.000Z","dependencies_parsed_at":"2023-01-19T23:16:53.282Z","dependency_job_id":null,"html_url":"https://github.com/zhex/page-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhex%2Fpage-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhex%2Fpage-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhex%2Fpage-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhex%2Fpage-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhex","download_url":"https://codeload.github.com/zhex/page-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242123334,"owners_count":20075348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T22:27:15.611Z","updated_at":"2025-03-06T00:16:01.912Z","avatar_url":"https://github.com/zhex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# page-webpack-plugin\n\nWebpack is awesome, but it is not webpages friendly. it using javascript file as the entry to handle all the staffs.This plugin give you the ability to handle your webpages separately. It copy all the webpages your want to the output path, and all assets links are replaced with the webpack compiled version.\n\n```javascript\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\nvar PagePlugin = require('page-webpack-plugin');\nvar glob = require('glob');\nvar path = require('path');\n\nvar cwd = process.cwd();\nvar entries = {};\n\nglob.sync('**/entry_*.js', {root: './src/js'}).forEach(function (f) {\n\tvar name = path.relative(cwd + '/src/js', f).replace(/\\.js$/, '');\n\tentries[name] = path.resolve(f);\n});\n\nmodule.exports = {\n\tentry: entries,\n\toutput: {\n\t\tpath: 'dist',\n\t\tpublicPath: '/app/',\n\t\tfilename: 'assets/[name].[chunkhash:8].js',\n\t\tchunkFilename: 'assets/[name].[chunkhash:8].js'\n\t},\n\tmodule: {\n\t\tloaders: [\n\t\t\t{ test: /\\.(jpe?g|png|gif|svg)$/i, loaders: [\n\t\t\t\t'image?{bypassOnDebug: true, progressive:true, optimizationLevel: 3, pngquant:{quality: \"65-80\", speed: 4}}',\n\t\t\t\t'url?limit=100\u0026name=assets/img/[name].[hash:8].[ext]'\n\t\t\t]},\n\t\t\t{\n\t\t\t\ttest: /\\.less$/,\n\t\t\t\tloader: ExtractTextPlugin.extract('style', 'css!less')\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.html$/,\n\t\t\t\tloader: 'html'\n\t\t\t}\n\t\t]\n\t},\n\tplugins: [\n\t\tnew ExtractTextPlugin('assets/[name].[contenthash:8].css', { allChunks: true }),\n\t\t\n\t\tnew PagePlugin({\n\t\t\tcwd: __dirname + '/src',\n\t\t\tfiles: '**/*.html',\n\t\t\toutputPageName: function (filename) {\n\t\t\t\treturn filename;\n\t\t\t}, \n\t\t\tentryName: function (name) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t})\n\t]\n};\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhex%2Fpage-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhex%2Fpage-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhex%2Fpage-webpack-plugin/lists"}