@empjs/plugin-vue3 3.0.0-rc.22 → 3.0.0-rc.28

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.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of p(e))!a.call(t,u)&&u!==r&&s(t,u,{get:()=>e[u],enumerable:!(l=i(e,u))||l.enumerable});return t};var d=t=>c(s({},"__esModule",{value:!0}),t);var v={};m(v,{default:()=>f});module.exports=d(v);var _=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,o=_();var n=require("vue-loader"),f=()=>({name:"@empjs/plugin-vue3",async rsConfig(t){let{importResolve:e,chain:r}=t;r.module.rule("javascript").test(/\.js$/),r.module.rule("typescript").test(/\.ts$/),r.plugin("vue-loader-plugin").use(n.VueLoaderPlugin,[]),r.module.rule("vue-loader").test(/\.vue$/).use("vue-loader").loader(e("vue-loader",o)).options({compilerOptions:{preserveWhitespace:!1},experimentalInlineMatchResource:!0}).end(),r.module.rule("vue-jtsx").test(/\.(jsx|tsx)$/).use("babel-loader").loader(e("babel-loader",o)).options({presets:[[e("@babel/preset-typescript",o),{isTSX:!0,allExtensions:!0}]],plugins:[[e("@vue/babel-plugin-jsx",o),{optimize:!0}]]}).end(),t.chain.plugin("definePlugin").tap(l=>{let u={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1};return l[0]={...u,...l[0]},l}),t.chain.merge({module:{rule:{svg:{type:"asset/resource"}}}})}});
@@ -0,0 +1,14 @@
1
+ import { GlobalStore } from '@empjs/cli';
2
+
3
+ declare const _default: () => {
4
+ name: string;
5
+ rsConfig(store: GlobalStore): Promise<void>;
6
+ };
7
+ /**
8
+ * @vue/compiler-sfc
9
+ * Note: as of 3.2.13+, this package is included as a dependency of the main vue package and can be accessed as vue/compiler-sfc.
10
+ * This means you no longer need to explicitly install this package and ensure its version match that of vue's.
11
+ * Just use the main vue/compiler-sfc deep import instead.
12
+ */
13
+
14
+ export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
- import type { GlobalStore } from '@empjs/cli';
1
+ import { GlobalStore } from '@empjs/cli';
2
+
2
3
  declare const _default: () => {
3
4
  name: string;
4
5
  rsConfig(store: GlobalStore): Promise<void>;
5
6
  };
6
- export default _default;
7
7
  /**
8
8
  * @vue/compiler-sfc
9
9
  * Note: as of 3.2.13+, this package is included as a dependency of the main vue package and can be accessed as vue/compiler-sfc.
10
10
  * This means you no longer need to explicitly install this package and ensure its version match that of vue's.
11
11
  * Just use the main vue/compiler-sfc deep import instead.
12
12
  */
13
+
14
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,110 +1 @@
1
- import { VueLoaderPlugin } from 'vue-loader';
2
- //
3
- export default () => {
4
- return {
5
- name: '@empjs/plugin-vue3',
6
- async rsConfig(store) {
7
- const { importResolve, chain } = store;
8
- //
9
- // store.merge({
10
- // experiments: {
11
- // rspackFuture: {
12
- // newTreeshaking: true, // 该功能启用了与 webpack 相同的新摇树优化实现,可以生成更高效和更小的代码。
13
- // },
14
- // },
15
- // })
16
- //
17
- // reset
18
- // chain.module.rule('javascript').uses.clear().end()
19
- // chain.module.rule('typescript').uses.clear().end()
20
- chain.module.rule('javascript').test(/\.js$/);
21
- chain.module.rule('typescript').test(/\.ts$/);
22
- // plugin
23
- chain.plugin('vue-loader-plugin').use(VueLoaderPlugin, []);
24
- // module
25
- chain.module
26
- .rule('vue-loader')
27
- .test(/\.vue$/)
28
- .use('vue-loader')
29
- .loader(importResolve('vue-loader', import.meta.url))
30
- .options({
31
- compilerOptions: {
32
- preserveWhitespace: false,
33
- },
34
- experimentalInlineMatchResource: true,
35
- })
36
- .end();
37
- //jsx and tsx compile
38
- chain.module
39
- .rule('vue-jtsx')
40
- // .test(/\.(js|jsx|ts|tsx)$/)
41
- .test(/\.(jsx|tsx)$/)
42
- .use('babel-loader')
43
- .loader(importResolve('babel-loader', import.meta.url))
44
- .options({
45
- presets: [
46
- [
47
- importResolve('@babel/preset-typescript', import.meta.url),
48
- {
49
- isTSX: true, // allExtensions依赖isTSX https://babeljs.io/docs/en/babel-preset-typescript#allextensions
50
- allExtensions: true, // 支持所有文件扩展名
51
- },
52
- ],
53
- ],
54
- plugins: [[importResolve('@vue/babel-plugin-jsx', import.meta.url), { optimize: true }]],
55
- })
56
- .end();
57
- // define
58
- store.chain.plugin('definePlugin').tap(args => {
59
- // https://link.vuejs.org/feature-flags
60
- const o = {
61
- __VUE_OPTIONS_API__: true,
62
- __VUE_PROD_DEVTOOLS__: false,
63
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
64
- };
65
- args[0] = {
66
- ...o,
67
- ...args[0],
68
- };
69
- return args;
70
- });
71
- // chain config
72
- store.chain.merge({
73
- module: {
74
- rule: {
75
- svg: {
76
- type: 'asset/resource',
77
- },
78
- // vue js and ts compile
79
- // vuejs: {
80
- // test: /\.(js|ts)$/,
81
- // exclude: store.empConfig.moduleTransformRule,
82
- // sideEffects: false, // 标记模块是否存在副作用。
83
- // use: [
84
- // {
85
- // loader: 'builtin:swc-loader',
86
- // options: {
87
- // jsc: {
88
- // parser: {
89
- // syntax: 'typescript',
90
- // decorators: true,
91
- // tsx: true,
92
- // dynamicImport: true,
93
- // },
94
- // },
95
- // },
96
- // },
97
- // ],
98
- // },
99
- },
100
- },
101
- });
102
- },
103
- };
104
- };
105
- /**
106
- * @vue/compiler-sfc
107
- * Note: as of 3.2.13+, this package is included as a dependency of the main vue package and can be accessed as vue/compiler-sfc.
108
- * This means you no longer need to explicitly install this package and ensure its version match that of vue's.
109
- * Just use the main vue/compiler-sfc deep import instead.
110
- */
1
+ import{VueLoaderPlugin as o}from"vue-loader";var p=()=>({name:"@empjs/plugin-vue3",async rsConfig(l){let{importResolve:t,chain:e}=l;e.module.rule("javascript").test(/\.js$/),e.module.rule("typescript").test(/\.ts$/),e.plugin("vue-loader-plugin").use(o,[]),e.module.rule("vue-loader").test(/\.vue$/).use("vue-loader").loader(t("vue-loader",import.meta.url)).options({compilerOptions:{preserveWhitespace:!1},experimentalInlineMatchResource:!0}).end(),e.module.rule("vue-jtsx").test(/\.(jsx|tsx)$/).use("babel-loader").loader(t("babel-loader",import.meta.url)).options({presets:[[t("@babel/preset-typescript",import.meta.url),{isTSX:!0,allExtensions:!0}]],plugins:[[t("@vue/babel-plugin-jsx",import.meta.url),{optimize:!0}]]}).end(),l.chain.plugin("definePlugin").tap(r=>{let u={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1};return r[0]={...u,...r[0]},r}),l.chain.merge({module:{rule:{svg:{type:"asset/resource"}}}})}});export{p as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empjs/plugin-vue3",
3
- "version": "3.0.0-rc.22",
3
+ "version": "3.0.0-rc.28",
4
4
  "description": "emp vue3 plugin",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,23 +18,28 @@
18
18
  "main": "dist/index.js",
19
19
  "types": "dist/index.d.ts",
20
20
  "exports": {
21
- ".": "./dist/index.js"
21
+ ".": {
22
+ "import": {
23
+ "default": "./dist/index.js",
24
+ "types": "./dist/index.d.ts"
25
+ },
26
+ "require": {
27
+ "default": "./dist/index.cjs",
28
+ "types": "./dist/index.d.cts"
29
+ }
30
+ }
22
31
  },
23
32
  "scripts": {
24
- "dev": "rimraf dist && pnpm run /^dev:.*/",
25
- "dev:tsc": "tsc -w",
26
- "dev:tsc-alias": "tsc-alias -w",
27
- "build": "rimraf dist && pnpm run /^build:.*/",
28
- "build:ts": "tsc && tsc-alias"
33
+ "build": "tsup",
34
+ "dev": "tsup --watch"
29
35
  },
30
36
  "engines": {
31
- "node": ">=20.0.0"
37
+ "node": ">=18.0.0"
32
38
  },
33
39
  "author": "Ken",
34
40
  "devDependencies": {
35
41
  "@empjs/cli": "workspace:*",
36
- "rimraf": "^5.0.5",
37
- "tsc-alias": "^1.8.8"
42
+ "tsup": "^8.0.2"
38
43
  },
39
44
  "dependencies": {
40
45
  "@babel/preset-typescript": "^7.24.1",