@modern-js/plugin-module-vue 0.0.0-nightly-20231031173446

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present Modern.js
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @modern-js/plugin-module-vue
2
+
3
+ The Vue plugin of Modern.js Module.
4
+
5
+ The Vue plugin provides support for building Vue 3 components. The plugin internally integrates [esbuild-plugin-vue3](https://github.com/pipe01/esbuild-plugin-vue3) and [@vue/babel-plugin-jsx](https://github.com/vuejs/babel-plugin-jsx).
6
+
7
+ See <http://modernjs.dev/module-tools/plugins/official-list/plugin-vue.html> for details.
@@ -0,0 +1,5 @@
1
+ import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
2
+ import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx';
3
+ export declare const modulePluginVue: (options?: {
4
+ vueJsxPluginOptions?: VueJSXPluginOptions;
5
+ }) => CliPlugin<ModuleTools>;
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ modulePluginVue: () => modulePluginVue
32
+ });
33
+ module.exports = __toCommonJS(src_exports);
34
+ var import_esbuild_plugin_vue3 = __toESM(require("esbuild-plugin-vue3"));
35
+ var import_plugin_module_babel = require("@modern-js/plugin-module-babel");
36
+ const modulePluginVue = (options) => ({
37
+ name: "vue-plugin",
38
+ usePlugins: [
39
+ (0, import_plugin_module_babel.modulePluginBabel)({
40
+ plugins: [
41
+ [
42
+ require("@babel/plugin-syntax-typescript"),
43
+ {
44
+ isTSX: true
45
+ }
46
+ ],
47
+ [
48
+ require("@vue/babel-plugin-jsx"),
49
+ {
50
+ ...options === null || options === void 0 ? void 0 : options.vueJsxPluginOptions
51
+ }
52
+ ]
53
+ ]
54
+ })
55
+ ],
56
+ setup: () => ({
57
+ beforeBuildTask(config) {
58
+ const lastEsbuildOptions = config.esbuildOptions;
59
+ config.esbuildOptions = (c) => {
60
+ var _lastEsbuildConfig_plugins;
61
+ const lastEsbuildConfig = lastEsbuildOptions(c);
62
+ (_lastEsbuildConfig_plugins = lastEsbuildConfig.plugins) === null || _lastEsbuildConfig_plugins === void 0 ? void 0 : _lastEsbuildConfig_plugins.unshift((0, import_esbuild_plugin_vue3.default)());
63
+ return lastEsbuildConfig;
64
+ };
65
+ config.jsx = "preserve";
66
+ return config;
67
+ }
68
+ })
69
+ });
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ modulePluginVue
73
+ });
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@modern-js/plugin-module-vue",
3
+ "version": "0.0.0-nightly-20231031173446",
4
+ "description": "The vue plugin of Modern.js Module",
5
+ "keywords": [
6
+ "react",
7
+ "framework",
8
+ "modern",
9
+ "modern.js"
10
+ ],
11
+ "homepage": "https://modernjs.dev/module-tools",
12
+ "bugs": "https://github.com/web-infra-dev/modern.js/issues",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/web-infra-dev/modern.js",
16
+ "directory": "packages/module/plugin-module-vue"
17
+ },
18
+ "license": "MIT",
19
+ "sideEffects": false,
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "dependencies": {
23
+ "@babel/core": "^7.22.5",
24
+ "@babel/plugin-syntax-typescript": "7.22.5",
25
+ "@swc/helpers": "0.5.1",
26
+ "@vue/babel-plugin-jsx": "1.1.5",
27
+ "esbuild-plugin-vue3": "0.3.2",
28
+ "@modern-js/plugin-module-babel": "0.0.0-nightly-20231031173446"
29
+ },
30
+ "devDependencies": {
31
+ "@types/babel__core": "7.1.16",
32
+ "@types/node": "^14",
33
+ "jest": "^29",
34
+ "typescript": "^5",
35
+ "@modern-js/module-tools": "0.0.0-nightly-20231031173446",
36
+ "@scripts/build": "0.0.0-nightly-20231031173446"
37
+ },
38
+ "peerDependencies": {
39
+ "@modern-js/module-tools": "0.0.0-nightly-20231031173446"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "provenance": true,
44
+ "registry": "https://registry.npmjs.org/"
45
+ },
46
+ "scripts": {
47
+ "build": "mdn build",
48
+ "dev": "mdn build --watch"
49
+ }
50
+ }