{"_id":"@canvases/multi-project-webpack-plugin","_rev":"4-300984b7396578014edb7d175cd5151e","name":"@canvases/multi-project-webpack-plugin","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@canvases/multi-project-webpack-plugin","version":"1.0.0","keywords":["webpack","webpack-plugin","multi-project","configurable-build","conditional-compilation","differentiated-build","custom-webpack-plugin"],"author":{"name":"canvases"},"license":"MIT","_id":"@canvases/multi-project-webpack-plugin@1.0.0","maintainers":[{"name":"canvases","email":"canvases@163.com"}],"dist":{"shasum":"7837d663b7b533b54b380e506ce7b3139e5767da","tarball":"https://registry.npmjs.org/@canvases/multi-project-webpack-plugin/-/multi-project-webpack-plugin-1.0.0.tgz","fileCount":6,"integrity":"sha512-CkBmY+al2JXaX4R3aM3EAZkYwnVpojG56bPdb/ciI6Tbk+rO3+YXhRfRNvoaGidTGpQgt8qhRyFhLmo2I5Ff3Q==","signatures":[{"sig":"MEQCID4m0uD9DnPEzSvaeC70RuOpBtZPt7ONDqO8sU7uk6fGAiAl5YkjoChUa4QUa36qB+tdjFxhoOvOk8PaNIFHP8H4Ew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3703},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"canvases","email":"canvases@163.com"},"_npmVersion":"10.8.2","description":"\"A Webpack plugin that enables multi-project configuration support, allowing different code blocks to be compiled or executed based on configuration files.","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.98.0"},"peerDependencies":{"webpack":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/multi-project-webpack-plugin_1.0.0_1741923587435_0.56734610911505","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@canvases/multi-project-webpack-plugin","version":"1.0.1","keywords":["webpack","webpack-plugin","multi-project","configurable-build","conditional-compilation","differentiated-build","custom-webpack-plugin"],"author":{"name":"canvases"},"license":"MIT","_id":"@canvases/multi-project-webpack-plugin@1.0.1","maintainers":[{"name":"canvases","email":"canvases@163.com"}],"dist":{"shasum":"60e21e67bb16545b5c3a7825d6b47a3598177c4e","tarball":"https://registry.npmjs.org/@canvases/multi-project-webpack-plugin/-/multi-project-webpack-plugin-1.0.1.tgz","fileCount":6,"integrity":"sha512-/5j4LLWtn9vwGD0W03qhwHbeOLYXUPPoQCw3jo32voeFWoiWocIx5YmQitST/XtOkG7muEZqqWNd4O0MjOXP2A==","signatures":[{"sig":"MEQCIHZs5Zkc1Lg7FqU7eIy+wEaHAztckOm9kFqUBGySgoDTAiAXHK/tGPfMNuhecB/wSDgyJU56F/wqQTxJelIM6oA9iQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3691},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"canvases","email":"canvases@163.com"},"_npmVersion":"10.8.2","description":"\"A Webpack plugin that enables multi-project configuration support, allowing different code blocks to be compiled or executed based on configuration files.","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.98.0"},"peerDependencies":{"webpack":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/multi-project-webpack-plugin_1.0.1_1741923982053_0.40829636405627734","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@canvases/multi-project-webpack-plugin","version":"1.0.2","keywords":["webpack","webpack-plugin","multi-project","configurable-build","conditional-compilation","differentiated-build","custom-webpack-plugin"],"author":{"name":"canvases"},"license":"MIT","_id":"@canvases/multi-project-webpack-plugin@1.0.2","maintainers":[{"name":"canvases","email":"canvases@163.com"}],"dist":{"shasum":"2d313f012d168a92768d5d14e3963941f8885533","tarball":"https://registry.npmjs.org/@canvases/multi-project-webpack-plugin/-/multi-project-webpack-plugin-1.0.2.tgz","fileCount":6,"integrity":"sha512-SCTYxin0nzWhFc14+E77st0NLMdpEnxKpiBummBXZpnZ+kwz9SauCtKf3hBL2yQI6OLQmU18uqah9q6+huyEKA==","signatures":[{"sig":"MEUCIQDgNzeEiyb9+sF8fQae0oS5A1W01vMe+vTtkIiTHDbBFwIgUQDLan9LCnKv0JJZRVrzcCFfRDVk2/Mv9AGkt4FV1bY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3691},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"canvases","email":"canvases@163.com"},"_npmVersion":"10.8.2","description":"\"A Webpack plugin that enables multi-project configuration support, allowing different code blocks to be compiled or executed based on configuration files.","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.98.0"},"peerDependencies":{"webpack":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/multi-project-webpack-plugin_1.0.2_1741924189585_0.4997366966558243","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@canvases/multi-project-webpack-plugin","version":"1.0.3","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["webpack","webpack-plugin","multi-project","configurable-build","conditional-compilation","differentiated-build","custom-webpack-plugin"],"author":{"name":"canvases"},"license":"MIT","description":"\"A Webpack plugin that enables multi-project configuration support, allowing different code blocks to be compiled or executed based on configuration files.","peerDependencies":{"webpack":"^4.0.0"},"devDependencies":{"webpack":"^5.98.0"},"_id":"@canvases/multi-project-webpack-plugin@1.0.3","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-bNpHD/4rEq+K8XpaKK7hnZOaTlJc77pc7grpq1V4QMUoD+0CFieQzs/2Fv4qiG8J5DnrU8UDRatwtW05CR6FEw==","shasum":"90ab91369650660dbf9c2ab09dff0dfe069cd5b3","tarball":"https://registry.npmjs.org/@canvases/multi-project-webpack-plugin/-/multi-project-webpack-plugin-1.0.3.tgz","fileCount":7,"unpackedSize":6439,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBBsbaydRlnWAJsn0yiQ42jp6pu6qw8AlvkHrlnXczOFAiBsc7hMqdMqY7ftsqdooEz3NTBOKuNpSRLZmz+88b+twA=="}]},"_npmUser":{"name":"canvases","email":"canvases@163.com"},"directories":{},"maintainers":[{"name":"canvases","email":"canvases@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/multi-project-webpack-plugin_1.0.3_1741932874445_0.27936973458699454"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-14T03:39:47.348Z","modified":"2025-03-14T06:14:34.830Z","1.0.0":"2025-03-14T03:39:47.618Z","1.0.1":"2025-03-14T03:46:22.240Z","1.0.2":"2025-03-14T03:49:49.790Z","1.0.3":"2025-03-14T06:14:34.666Z"},"author":{"name":"canvases"},"license":"MIT","keywords":["webpack","webpack-plugin","multi-project","configurable-build","conditional-compilation","differentiated-build","custom-webpack-plugin"],"description":"\"A Webpack plugin that enables multi-project configuration support, allowing different code blocks to be compiled or executed based on configuration files.","maintainers":[{"name":"canvases","email":"canvases@163.com"}],"readme":"# Multi Project Webpack Plugin\r\n\r\n## Description\r\n`multi-project-webpack-plugin` is a Webpack plugin that enables multi-project configuration support. It allows you to define different build or runtime code blocks for different project scenarios based on a configuration file.\r\n\r\n## Features\r\n- 🏗 **Multi-Project Support**: Customize builds for different projects using configuration files.\r\n- 🎯 **Conditional Compilation**: Compile only the necessary code blocks for a specific project.\r\n- ⚡ **Flexible Configuration**: Supports JSON/YAML configuration for easy customization.\r\n- 🚀 **Enhances Webpack Builds**: Helps streamline multi-project workflows by reducing redundant code.\r\n\r\n## Installation\r\n```sh\r\nnpm install @canvases/multi-project-webpack-plugin --save-dev\r\n````\r\n\r\n### As defined in the configuration file\r\n\r\n```js\r\nconst path = require('path');\r\nconst MultiProjectWebpackPlugin = require('@canvases/multi-project-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    resolve: {\r\n        alias: {\r\n            '@': path.resolve(__dirname, 'src')  // “@” 指向项目根目录下的 src 文件夹\r\n        }\r\n    },\r\n    plugins: [\r\n        new webpack.DefinePlugin({\r\n            'process.env.PLATFORM': JSON.stringify(process.env.PLATFORM)\r\n        }),\r\n        //     // 自定义条件编译插件\r\n        new MultiProjectWebpackPlugin({\r\n            platform: process.env.PLATFORM,\r\n            entryPath: './manifest.json',\r\n            exportPath: '@/config.js',  // 使用 alias 指向配置文件,并在项目中引入, 可用window.CODE_CONFIG 调用\r\n        }),\r\n    ]\r\n};\r\n```\r\n","readmeFilename":"README.md"}