@modern-js/plugin-module-babel 2.0.0-beta.3 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -5
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { CliPlugin, ModuleTools } from '@modern-js/module-tools
|
|
1
|
+
import { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
2
|
import { babelPresetPlugin } from '@modern-js/libuild-plugin-babel-preset';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
declare type Options = typeof babelPresetPlugin extends (arg1: infer P1, arg2: infer P2) => void ? {
|
|
5
|
+
internalPresetOptions?: P1;
|
|
6
|
+
babelTransformOptions?: P2;
|
|
6
7
|
} : never;
|
|
7
|
-
|
|
8
|
+
declare const ModulePluginBabel: (options?: Options) => CliPlugin<ModuleTools>;
|
|
9
|
+
|
|
10
|
+
export { ModulePluginBabel, Options };
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
ModulePluginBabel: () => ModulePluginBabel
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
name:
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_libuild_plugin_babel_preset = require("@modern-js/libuild-plugin-babel-preset");
|
|
24
|
+
var ModulePluginBabel = (options) => ({
|
|
25
|
+
name: "babel-plugin",
|
|
10
26
|
setup: () => ({
|
|
11
27
|
modifyLibuild(config) {
|
|
12
|
-
var
|
|
13
|
-
(
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = config.plugins) == null ? void 0 : _a.unshift(
|
|
30
|
+
(0, import_libuild_plugin_babel_preset.babelPresetPlugin)(
|
|
31
|
+
options == null ? void 0 : options.internalPresetOptions,
|
|
32
|
+
options == null ? void 0 : options.babelTransformOptions
|
|
33
|
+
)
|
|
34
|
+
);
|
|
14
35
|
return config;
|
|
15
36
|
}
|
|
16
37
|
})
|
|
17
38
|
});
|
|
18
|
-
|
|
39
|
+
|
|
19
40
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,yCAAkC;AAY3B,IAAM,oBAAoB,CAC/B,aAC4B;AAAA,EAC5B,MAAM;AAAA,EACN,OAAO,OAAO;AAAA,IACZ,cAAc,QAAQ;AAlB1B;AAmBM,mBAAO,YAAP,mBAAgB;AAAA,YACd;AAAA,UACE,mCAAS;AAAA,UACT,mCAAS;AAAA,QACX;AAAA;AAEF,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { CliPlugin, ModuleTools } from '@modern-js/module-tools';\nimport { babelPresetPlugin } from '@modern-js/libuild-plugin-babel-preset';\n\nexport type Options = typeof babelPresetPlugin extends (\n arg1: infer P1,\n arg2: infer P2,\n) => void\n ? {\n internalPresetOptions?: P1;\n babelTransformOptions?: P2;\n }\n : never;\n\nexport const ModulePluginBabel = (\n options?: Options,\n): CliPlugin<ModuleTools> => ({\n name: 'babel-plugin',\n setup: () => ({\n modifyLibuild(config) {\n config.plugins?.unshift(\n babelPresetPlugin(\n options?.internalPresetOptions,\n options?.babelTransformOptions,\n ),\n );\n return config;\n },\n }),\n});\n"]}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.4",
|
|
15
15
|
"types": "./dist/types/index.d.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"dependencies": {
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"@types/node": "^14",
|
|
23
23
|
"typescript": "^4",
|
|
24
24
|
"jest": "^27",
|
|
25
|
-
"@scripts/build": "2.0.0-beta.
|
|
26
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
27
|
-
"@modern-js/module-tools
|
|
25
|
+
"@scripts/build": "2.0.0-beta.4",
|
|
26
|
+
"@scripts/jest-config": "2.0.0-beta.4",
|
|
27
|
+
"@modern-js/module-tools": "2.0.0-beta.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@modern-js/module-tools
|
|
30
|
+
"@modern-js/module-tools": "2.0.0-beta.4"
|
|
31
31
|
},
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"publishConfig": {
|