Skip to content

Commit

Permalink
Version independent Webpack package (#91)
Browse files Browse the repository at this point in the history
* Prepare version independent Webpack package

* Implement plugin-webpack/index.cjs

* Add README.md

* Add package to root README.md
  • Loading branch information
kungfooman authored Dec 14, 2023
1 parent 6a5d02d commit d6572b4
Show file tree
Hide file tree
Showing 7 changed files with 7,928 additions and 533 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ module.exports = {
"prefer-spread": "warn",
"prefer-template": "off",
"quote-props": "off",
"radix": "error",
// "radix": "error",
"require-await": "error",
"require-unicode-regexp": "off",
"require-yield": "error",
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ console.log(rtiTranspiler)
2) https://www.npmjs.com/package/@runtime-type-inspector/transpiler
3) https://www.npmjs.com/package/@runtime-type-inspector/parcel-transformer
4) https://www.npmjs.com/package/@runtime-type-inspector/plugin-rollup
5) https://www.npmjs.com/package/@runtime-type-inspector/plugin-webpack4
6) https://www.npmjs.com/package/@runtime-type-inspector/plugin-webpack5
5) https://www.npmjs.com/package/@runtime-type-inspector/plugin-webpack (version independent)
6) https://www.npmjs.com/package/@runtime-type-inspector/plugin-webpack4
7) https://www.npmjs.com/package/@runtime-type-inspector/plugin-webpack5
13 changes: 13 additions & 0 deletions plugin-webpack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version independent Webpack plugin for `@runtime-type-inspector/transpiler`.

Installation:

```sh
npm install @runtime-type-inspector/plugin-webpack
```

Example of integration into your build script:

- https://github.com/xenova/transformers.js/pull/409

Have fun! If you run into any issues, please open an issue at https://github.com/kungfooman/RuntimeTypeInspector.js
6 changes: 6 additions & 0 deletions plugin-webpack/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const {version} = require('webpack');
if (parseInt(version) <= 4) {
module.exports = require('@runtime-type-inspector/plugin-webpack4');
} else {
module.exports = require('@runtime-type-inspector/plugin-webpack5');
}
4 changes: 0 additions & 4 deletions plugin-webpack/index.mjs

This file was deleted.

8,422 changes: 7,897 additions & 525 deletions plugin-webpack/package-lock.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion plugin-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"name": "@runtime-type-inspector/plugin-webpack",
"version": "1.0.0",
"description": "Webpack plugin for https://runtimetypeinspector.org/",
"main": "index.cjs",
"author": "Hermann Rolfes (kungfooman)",
"license": "MIT",
"dependencies": {
"@runtime-type-inspector/transpiler": "^2.1.1"
"@runtime-type-inspector/plugin-webpack4": "latest",
"@runtime-type-inspector/plugin-webpack5": "latest"
}
}

0 comments on commit d6572b4

Please sign in to comment.