{"_id":"y-conditional-webpack-plugin","_rev":"3-a264fe911883f3357142bfedd237437e","name":"y-conditional-webpack-plugin","dist-tags":{"latest":"1.0.9"},"versions":{"1.0.6":{"name":"y-conditional-webpack-plugin","version":"1.0.6","description":"A Webpack loader that can ignore compilation content through conditions.","main":"./dist/index.js","scripts":{"build":"rimraf dist && node scripts/build.js","serve":"rimraf dist && node scripts/build.js --w","build:types":"rimraf temp && tsc --declaration --emitDeclarationOnly --outDir temp && api-extractor run -c config/api-extractor.json && rimraf temp","test":"jest -c config/jest.config.js"},"keywords":["conditional","webpack","compile","optimize","react","vue","jsx"],"author":{"name":"jo_y"},"license":"MIT","devDependencies":{"@cellent/color-print":"^0.0.4","@microsoft/api-extractor":"^7.38.4","@types/jest":"^29.5.11","@types/node":"^20.12.7","@types/qs":"^6.9.10","cross-env":"^7.0.3","jest":"^29.7.0","rimraf":"^5.0.5","rollup":"^4.6.1","rollup-plugin-typescript2":"^0.36.0","strip-ansi":"6.0.1","ts-jest":"^29.1.1","typescript":"^5.3.2"},"dependencies":{"qs":"^6.11.2"},"_id":"y-conditional-webpack-plugin@1.0.6","_nodeVersion":"20.11.0","_npmVersion":"10.4.0","dist":{"integrity":"sha512-RO5y8jL9wEu1qQbafkFfIufBTSy7UN5qIgRR7dDfo4CiKA0TCpQfEt4oZ5/45iS8gxcqYzlEV71bzpOIkgobmQ==","shasum":"23f20316c574b8f6198528a8272e9d7226adf95a","tarball":"https://registry.npmjs.org/y-conditional-webpack-plugin/-/y-conditional-webpack-plugin-1.0.6.tgz","fileCount":12,"unpackedSize":27645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpnhsndCNJs0AJbC9S1FnjozIOkqGkVbx3VOcImkmJsQIgF8MovE/1HBVFl/MWu9vjczmEAb5N4Fh3dHO2j8a9jQY="}]},"_npmUser":{"name":"jo_y","email":"yanghai991@126.com"},"directories":{},"maintainers":[{"name":"jo_y","email":"yanghai991@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/y-conditional-webpack-plugin_1.0.6_1714240589639_0.9803820487937034"},"_hasShrinkwrap":false},"1.0.7":{"name":"y-conditional-webpack-plugin","version":"1.0.7","description":"A Webpack loader that can ignore compilation content through conditions.","main":"./dist/index.js","scripts":{"build":"rimraf dist && node scripts/build.js","serve":"rimraf dist && node scripts/build.js --w","build:types":"rimraf temp && tsc --declaration --emitDeclarationOnly --outDir temp && api-extractor run -c config/api-extractor.json && rimraf temp","test":"jest -c config/jest.config.js"},"keywords":["conditional","webpack","compile","optimize","react","vue","jsx"],"author":{"name":"jo_y"},"license":"MIT","devDependencies":{"@cellent/color-print":"^0.0.4","@microsoft/api-extractor":"^7.38.4","@types/jest":"^29.5.11","@types/node":"^20.12.7","@types/qs":"^6.9.10","cross-env":"^7.0.3","jest":"^29.7.0","rimraf":"^5.0.5","rollup":"^4.6.1","rollup-plugin-typescript2":"^0.36.0","strip-ansi":"6.0.1","ts-jest":"^29.1.1","typescript":"^5.3.2"},"dependencies":{"qs":"^6.11.2"},"_id":"y-conditional-webpack-plugin@1.0.7","_nodeVersion":"20.11.0","_npmVersion":"10.4.0","dist":{"integrity":"sha512-k1im2TWRPIPjm5pVIbcMn3mdJj6aNXRJsWrp0zru0V0o2bcZYF12KjMC8tw2L49q1T4dyzfMKqTQc/Gf3nQDhA==","shasum":"a026ec3c8aa1c8d354887254aad1fceb1fba7020","tarball":"https://registry.npmjs.org/y-conditional-webpack-plugin/-/y-conditional-webpack-plugin-1.0.7.tgz","fileCount":11,"unpackedSize":27047,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGJVUIhwMLmH+6oOL4ijPACKKnWkYbtKO+2UrVjItphmAiBC0rret5C489S2whTn72VQkZAhp6wIBRg0nQgjiB/pEA=="}]},"_npmUser":{"name":"jo_y","email":"yanghai991@126.com"},"directories":{},"maintainers":[{"name":"jo_y","email":"yanghai991@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/y-conditional-webpack-plugin_1.0.7_1714245822994_0.851815088078288"},"_hasShrinkwrap":false},"1.0.8":{"name":"y-conditional-webpack-plugin","version":"1.0.8","description":"A Webpack loader that can ignore compilation content through conditions.","main":"./dist/index.js","scripts":{"build":"rimraf dist && node scripts/build.js","serve":"rimraf dist && node scripts/build.js --w","build:types":"rimraf temp && tsc --declaration --emitDeclarationOnly --outDir temp && api-extractor run -c config/api-extractor.json && rimraf temp","test":"jest -c config/jest.config.js"},"keywords":["conditional","webpack","compile","optimize","react","vue","jsx"],"author":{"name":"jo_y"},"license":"MIT","devDependencies":{"@cellent/color-print":"^0.0.4","@microsoft/api-extractor":"^7.38.4","@types/jest":"^29.5.11","@types/node":"^20.12.7","@types/qs":"^6.9.10","cross-env":"^7.0.3","jest":"^29.7.0","rimraf":"^5.0.5","rollup":"^4.6.1","rollup-plugin-typescript2":"^0.36.0","strip-ansi":"6.0.1","ts-jest":"^29.1.1","typescript":"^5.3.2"},"dependencies":{"qs":"^6.11.2"},"_id":"y-conditional-webpack-plugin@1.0.8","_nodeVersion":"20.11.0","_npmVersion":"10.4.0","dist":{"integrity":"sha512-P6A+N5/Sxa0MI6hP72ik2Lvs6gB1kUu+ITVPxk/KY4BiZFFFCJhlJGCj0KfeQcmT9+rA/IBXq5pvGvGe69EJ/Q==","shasum":"589c6ece912809e14d24d1b7fb30e1aa60d370f0","tarball":"https://registry.npmjs.org/y-conditional-webpack-plugin/-/y-conditional-webpack-plugin-1.0.8.tgz","fileCount":11,"unpackedSize":27162,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCePN5vye6Wf+6qbx8ChUTnD0ZSdcZLAS+FDo+W3kfBQQIhALPrMAXxUFXHC+vY/0PyA9UD/dooDLVSszH29t8ympVp"}]},"_npmUser":{"name":"jo_y","email":"yanghai991@126.com"},"directories":{},"maintainers":[{"name":"jo_y","email":"yanghai991@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/y-conditional-webpack-plugin_1.0.8_1714246725306_0.17892876596489238"},"_hasShrinkwrap":false},"1.0.9":{"name":"y-conditional-webpack-plugin","version":"1.0.9","description":"A Webpack loader that can ignore compilation content through conditions.","main":"./dist/index.js","scripts":{"build":"rimraf dist && node scripts/build.js","serve":"rimraf dist && node scripts/build.js --w","build:types":"rimraf temp && tsc --declaration --emitDeclarationOnly --outDir temp && api-extractor run -c config/api-extractor.json && rimraf temp","test":"jest -c config/jest.config.js"},"keywords":["conditional","webpack","compile","optimize","react","vue","jsx"],"author":{"name":"jo_y"},"license":"MIT","devDependencies":{"@cellent/color-print":"^0.0.4","@microsoft/api-extractor":"^7.38.4","@types/jest":"^29.5.11","@types/node":"^20.12.7","@types/qs":"^6.9.10","cross-env":"^7.0.3","jest":"^29.7.0","rimraf":"^5.0.5","rollup":"^4.6.1","rollup-plugin-typescript2":"^0.36.0","strip-ansi":"6.0.1","ts-jest":"^29.1.1","typescript":"^5.3.2"},"dependencies":{"qs":"^6.11.2"},"_id":"y-conditional-webpack-plugin@1.0.9","_nodeVersion":"20.11.0","_npmVersion":"10.4.0","dist":{"integrity":"sha512-bhX9/rLThnl/6rbVPzMPUmSV7Xdm7AGbADluEJfdbx/H2cJ3ZqPg0r0lgqIP74b28dnm/rD9d3k2uJ8TguKYiA==","shasum":"f38cd0c7fbf41fe06f95ad779ef7378d2721f7d0","tarball":"https://registry.npmjs.org/y-conditional-webpack-plugin/-/y-conditional-webpack-plugin-1.0.9.tgz","fileCount":11,"unpackedSize":26989,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8fMB8DQzZ0Nd1v8lZ+upgnvBSYihh8Cvz7PFK5x2GiAiB5Fwq11X1GGYbjM9hDlJTKio8YIbzPWEBiRs7+ajI7MA=="}]},"_npmUser":{"name":"jo_y","email":"yanghai991@126.com"},"directories":{},"maintainers":[{"name":"jo_y","email":"yanghai991@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/y-conditional-webpack-plugin_1.0.9_1714385415785_0.5041863695411513"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-27T17:56:29.638Z","1.0.6":"2024-04-27T17:56:29.788Z","modified":"2024-04-29T10:10:16.084Z","1.0.7":"2024-04-27T19:23:43.139Z","1.0.8":"2024-04-27T19:38:45.456Z","1.0.9":"2024-04-29T10:10:15.926Z"},"maintainers":[{"name":"jo_y","email":"yanghai991@126.com"}],"description":"A Webpack loader that can ignore compilation content through conditions.","keywords":["conditional","webpack","compile","optimize","react","vue","jsx"],"author":{"name":"jo_y"},"license":"MIT","readme":"## Conditional-Webpack-Plugin\n\nA webpack plugin that could exclude the compiled content conditionally. That's very useful if you intent to compile you project with some different modules by run specify npm script. Note that this plugin is valid for fowllowing types of file: html[not template of Html-Webpack-Plugin], js, ts, jsx, tsx, vue, css, scss, sass, less\n\n<br/>\n\n### install\n\n```bash\nnpm install y-conditional-webpack-plugin -D\n```\n\n```bash\nyarn add y-conditional-webpack-plugin -D\n```\n\n```bash\npnpm i -D y-conditional-webpack-plugin\n```\n\n<br/>\n\n### Usage\n\n```js\n// webpack.config.js\n\nconst ConditionalWebpackPlugin = require(\"conditional-webpack-plugin\")\n\nmodule.exports = {\n\t// other configurations...\n\tplugins: [new ConditionalWebpackPlugin()],\n};\n```\n\nThere are two ways to exclude the content you don't want: `if true: statement` and `if def: variable`, and both of them need to use `endif` to mark the end:\n\n```js\nconsole.log(\"I will be shown\")\n\n// if true: true && 10 < 1\nconsole.log(\"I will not be shown\")\n// endif\n\n// if def: env.VARIABLE_NOT_EXIST\nconsle.log(\"I will not be shown either\")\n// endif\n```\n\nNo matter which way you will pick, the process.env will be added at the beginning of the scope. That is to say, VARIABLE will be attempted to be interpreted as process.env.VARIABLE.\n\nAlso, you maybe have noticed that `if def: env.VARIABLE` is the abbreviation form of `if true: env.VARIABLE !== undefined`\n","readmeFilename":"README.md"}