@empjs/plugin-vue3 3.0.0-beta.1 → 3.0.0-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -0
  2. package/package.json +1 -2
package/dist/index.js CHANGED
@@ -6,6 +6,14 @@ export default () => {
6
6
  async rsConfig(store) {
7
7
  const { importResolve, chain } = store;
8
8
  //
9
+ store.merge({
10
+ experiments: {
11
+ rspackFuture: {
12
+ newTreeshaking: true, // 该功能启用了与 webpack 相同的新摇树优化实现,可以生成更高效和更小的代码。
13
+ },
14
+ },
15
+ });
16
+ //
9
17
  // reset
10
18
  chain.module.rule('javascript').uses.clear().end();
11
19
  chain.module.rule('typescript').uses.clear().end();
@@ -44,6 +52,20 @@ export default () => {
44
52
  plugins: [[importResolve('@vue/babel-plugin-jsx', import.meta.url), { optimize: true }]],
45
53
  })
46
54
  .end();
55
+ // define
56
+ store.chain.plugin('definePlugin').tap(args => {
57
+ // https://link.vuejs.org/feature-flags
58
+ const o = {
59
+ __VUE_OPTIONS_API__: true,
60
+ __VUE_PROD_DEVTOOLS__: false,
61
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
62
+ };
63
+ args[0] = {
64
+ ...o,
65
+ ...args[0],
66
+ };
67
+ return args;
68
+ });
47
69
  // chain config
48
70
  store.chain.merge({
49
71
  module: {
@@ -54,6 +76,8 @@ export default () => {
54
76
  // vue js and ts compile
55
77
  vuejs: {
56
78
  test: /\.(js|ts)$/,
79
+ exclude: store.empConfig.moduleTransformRule,
80
+ sideEffects: false,
57
81
  use: [
58
82
  {
59
83
  loader: 'builtin:swc-loader',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empjs/plugin-vue3",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "emp vue3 plugin",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,7 +48,6 @@
48
48
  "@babel/preset-typescript": "^7.23.3",
49
49
  "@vue/babel-plugin-jsx": "^1.2.1",
50
50
  "babel-loader": "^9.1.3",
51
- "swc-plugin-vue-jsx": "^0.3.0",
52
51
  "vue": "^3.4.20",
53
52
  "vue-loader": "^17.4.2"
54
53
  }