babel-preset-taro 3.4.1 → 3.4.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.
Files changed (2) hide show
  1. package/package.json +7 -6
  2. package/rn/index.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-preset-taro",
3
- "version": "3.4.1",
3
+ "version": "3.4.4",
4
4
  "description": "> TODO: description",
5
5
  "author": "yuche <i@yuche.me>",
6
6
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme",
@@ -36,19 +36,20 @@
36
36
  "@babel/runtime": "^7.14.5",
37
37
  "@babel/runtime-corejs3": "^7.14.5",
38
38
  "@prefresh/babel-plugin": "^0.4.1",
39
- "@tarojs/helper": "3.4.1",
40
- "@tarojs/taro-h5": "3.4.1",
39
+ "@tarojs/helper": "3.4.4",
40
+ "@tarojs/taro-h5": "3.4.4",
41
41
  "@vue/babel-plugin-jsx": "^1.0.6",
42
42
  "@vue/babel-preset-jsx": "^1.2.4",
43
43
  "babel-plugin-dynamic-import-node": "2.3.3",
44
44
  "babel-plugin-global-define": "1.0.3",
45
45
  "babel-plugin-jsx-attributes-array-to-object": "0.3.0",
46
+ "babel-plugin-minify-dead-code-elimination": "0.5.1",
46
47
  "babel-plugin-transform-imports-api": "1.0.0",
47
- "babel-plugin-transform-react-jsx-to-rn-stylesheet": "3.4.1",
48
- "babel-plugin-transform-taroapi": "3.4.1",
48
+ "babel-plugin-transform-react-jsx-to-rn-stylesheet": "3.4.4",
49
+ "babel-plugin-transform-taroapi": "3.4.4",
49
50
  "core-js": "^3.6.5",
50
51
  "metro-react-native-babel-preset": "^0.66.2",
51
52
  "react-refresh": "0.9.0"
52
53
  },
53
- "gitHead": "a2437215b1966fd0b6dd09311bcb4fd894a871d0"
54
+ "gitHead": "099d062d74faa3f124ca2499de1154fae0adc4f9"
54
55
  }
package/rn/index.js CHANGED
@@ -108,7 +108,7 @@ module.exports = (_, options = {}) => {
108
108
  decoratorsBeforeExport,
109
109
  decoratorsLegacy
110
110
  } = options
111
- if (options.framework && options.framework !== 'react') {
111
+ if (options.framework && !['react', 'preact'].includes(options.framework)) {
112
112
  throw new Error(`Value "${options.framework}" of option "framework" is not supported for React-Native`)
113
113
  }
114
114
 
@@ -169,6 +169,10 @@ module.exports = (_, options = {}) => {
169
169
 
170
170
  plugins.push(require('../remove-define-config'))
171
171
 
172
+ plugins.push(
173
+ [require('babel-plugin-minify-dead-code-elimination'), {}]
174
+ )
175
+
172
176
  return {
173
177
  presets,
174
178
  plugins