{"id":13789252,"url":"https://github.com/guday/wepy-plugin-preprocess","last_synced_at":"2025-05-12T05:32:01.622Z","repository":{"id":88514351,"uuid":"107629992","full_name":"guday/wepy-plugin-preprocess","owner":"guday","description":"小程序wepy框架下的 preprocess plugin配置","archived":false,"fork":false,"pushed_at":"2017-10-20T06:36:09.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T00:38:47.944Z","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/guday.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-20T03:54:41.000Z","updated_at":"2018-09-12T05:51:05.000Z","dependencies_parsed_at":"2023-04-24T19:01:19.453Z","dependency_job_id":null,"html_url":"https://github.com/guday/wepy-plugin-preprocess","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"03f6e55f7ec38d9010fd6774cac803936271b5ad"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guday%2Fwepy-plugin-preprocess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guday%2Fwepy-plugin-preprocess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guday%2Fwepy-plugin-preprocess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guday%2Fwepy-plugin-preprocess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guday","download_url":"https://codeload.github.com/guday/wepy-plugin-preprocess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253682454,"owners_count":21946938,"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-08-03T21:01:00.663Z","updated_at":"2025-05-12T05:32:01.295Z","avatar_url":"https://github.com/guday.png","language":"JavaScript","funding_links":[],"categories":["微信小程序WePY框架开发资源汇总 ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)"],"sub_categories":["WePY开源组件"],"readme":"# wepy-plugin-preprocess\n\n## 用途\n\n* 小程序wepy框架下的 preprocess plugin配置\n* 对项目文件进行 preprocess 处理\n\n## 安装\n\n```\nnpm install wepy-plugin-preprocess --save-dev\n```\n\n## 配置`wepy.config.js`\n\n* 为 plugins 添加 preprocess 对象，支持单个或者多个规则，多个规则可以以 Array 或者 Object 实现。\n* 每个规则的filter 是个正则表达式。\n* 每个规则通过context配置条件上下文。\n\n\n```\nmodule.exports.plugins = {\n    'preprocess': {             //加载 wepy-plugin-preprocess\n        filter: /config\\.js$/,  //条件\n        context: {              //preprocess 的context参数\n            ENV: 'prod'\n        }\n    }\n};\n\n\nmodule.exports.plugins = {\n    'preprocess': [\n        {\n            filter: /config\\.js$/,\n            context: {\n                ENV: 'prod'\n            }\n        }, {\n            filter: /index\\.html$/,\n            context: {\n                ENV: 'prod'\n            }\n        }\n    ]\n};\n\nmodule.exports.plugins = {\n    'preprocess': {\n        'process-js': {\n            filter: /config\\.js$/,\n            context: {\n                ENV: 'prod'\n            }\n        },\n        'process-html': {\n            filter: /index\\.html$/,\n            context: {\n                ENV: 'prod'\n            }\n        }\n    }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguday%2Fwepy-plugin-preprocess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguday%2Fwepy-plugin-preprocess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguday%2Fwepy-plugin-preprocess/lists"}