@tuya-sat/micro-script 0.0.4 → 1.0.0-rc.1

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.
@@ -17,24 +17,19 @@ export default function getCommonConfig({ isDev, isBuild }: {
17
17
  rules: ({
18
18
  test: RegExp;
19
19
  use: any[];
20
- loader?: undefined;
21
- options?: undefined;
20
+ type?: undefined;
21
+ parser?: undefined;
22
+ generator?: undefined;
22
23
  } | {
23
24
  test: RegExp;
24
- use: {
25
- loader: string;
26
- options: {
27
- iesafe: boolean;
25
+ type: string;
26
+ parser: {
27
+ dataUrlCondition: {
28
+ maxSize: number;
28
29
  };
29
30
  };
30
- loader?: undefined;
31
- options?: undefined;
32
- } | {
33
- test: RegExp[];
34
- loader: string;
35
- options: {
36
- limit: number;
37
- name: string;
31
+ generator: {
32
+ filename: string;
38
33
  };
39
34
  use?: undefined;
40
35
  })[];
@@ -85,20 +85,15 @@ function getCommonConfig({ isDev, isBuild }) {
85
85
  }, "sass-loader"),
86
86
  },
87
87
  {
88
- test: /\.svg/,
89
- use: {
90
- loader: "svg-url-loader",
91
- options: {
92
- iesafe: true,
88
+ test: /\.(bmp|png|svg|jpg|jpeg|gif)$/i,
89
+ type: "asset",
90
+ parser: {
91
+ dataUrlCondition: {
92
+ maxSize: 10 * 1024,
93
93
  },
94
94
  },
95
- },
96
- {
97
- test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
98
- loader: "url-loader",
99
- options: {
100
- limit: 1024 * 10,
101
- name: "static/media/[name].[hash:8].[ext]",
95
+ generator: {
96
+ filename: "static/img/[hash][ext][query]",
102
97
  },
103
98
  },
104
99
  ].filter(Boolean),
@@ -133,6 +128,7 @@ function getCommonConfig({ isDev, isBuild }) {
133
128
  {
134
129
  from: paths_1.default.publicDir,
135
130
  filter: (resourcePath) => __awaiter(this, void 0, void 0, function* () { return !resourcePath.includes(".html"); }),
131
+ noErrorOnMissing: true,
136
132
  },
137
133
  ],
138
134
  }),
@@ -11,31 +11,20 @@ declare const vueTsConfig: ({ isDev, isBuild, currentFramework }: {
11
11
  use: {
12
12
  loader: string;
13
13
  options: {
14
- presets: (string | {
14
+ presets: ((string | {
15
15
  useBuiltIns: string;
16
16
  corejs: number;
17
- })[][];
17
+ })[] | (string | {
18
+ allExtensions: boolean;
19
+ })[])[];
18
20
  };
19
21
  }[];
20
- loader?: undefined;
21
- options?: undefined;
22
22
  } | {
23
23
  test: RegExp;
24
24
  include: string;
25
25
  use: {
26
26
  loader: string;
27
27
  }[];
28
- loader?: undefined;
29
- options?: undefined;
30
- } | {
31
- test: RegExp;
32
- include: string;
33
- loader: string;
34
- options: {
35
- appendTsSuffixTo: RegExp[];
36
- transpileOnly: boolean;
37
- };
38
- use?: undefined;
39
28
  } | {
40
29
  test: string;
41
30
  include: string;
@@ -45,8 +34,6 @@ declare const vueTsConfig: ({ isDev, isBuild, currentFramework }: {
45
34
  microFramework: any;
46
35
  };
47
36
  }[];
48
- loader?: undefined;
49
- options?: undefined;
50
37
  })[];
51
38
  };
52
39
  plugins: any[];
@@ -68,31 +55,20 @@ declare const vueJsConfig: ({ isDev, isBuild, currentFramework }: {
68
55
  use: {
69
56
  loader: string;
70
57
  options: {
71
- presets: (string | {
58
+ presets: ((string | {
72
59
  useBuiltIns: string;
73
60
  corejs: number;
74
- })[][];
61
+ })[] | (string | {
62
+ allExtensions: boolean;
63
+ })[])[];
75
64
  };
76
65
  }[];
77
- loader?: undefined;
78
- options?: undefined;
79
66
  } | {
80
67
  test: RegExp;
81
68
  include: string;
82
69
  use: {
83
70
  loader: string;
84
71
  }[];
85
- loader?: undefined;
86
- options?: undefined;
87
- } | {
88
- test: RegExp;
89
- include: string;
90
- loader: string;
91
- options: {
92
- appendTsSuffixTo: RegExp[];
93
- transpileOnly: boolean;
94
- };
95
- use?: undefined;
96
72
  } | {
97
73
  test: string;
98
74
  include: string;
@@ -102,8 +78,6 @@ declare const vueJsConfig: ({ isDev, isBuild, currentFramework }: {
102
78
  microFramework: any;
103
79
  };
104
80
  }[];
105
- loader?: undefined;
106
- options?: undefined;
107
81
  })[];
108
82
  };
109
83
  plugins: any[];
@@ -16,7 +16,7 @@ const vueConfig = ({ isDev, isBuild, currentFramework, isTs }) => {
16
16
  module: {
17
17
  rules: [
18
18
  {
19
- test: /\.js$/,
19
+ test: /\.(js|ts)$/,
20
20
  include: paths_js_1.default.appSrc,
21
21
  use: [
22
22
  {
@@ -30,7 +30,13 @@ const vueConfig = ({ isDev, isBuild, currentFramework, isTs }) => {
30
30
  corejs: 3,
31
31
  },
32
32
  ],
33
- ],
33
+ isTs && [
34
+ "@babel/preset-typescript",
35
+ {
36
+ allExtensions: true,
37
+ },
38
+ ],
39
+ ].filter(Boolean),
34
40
  },
35
41
  },
36
42
  ],
@@ -44,12 +50,6 @@ const vueConfig = ({ isDev, isBuild, currentFramework, isTs }) => {
44
50
  },
45
51
  ],
46
52
  },
47
- isTs && {
48
- test: /\.ts$/,
49
- include: paths_js_1.default.appSrc,
50
- loader: "ts-loader",
51
- options: { appendTsSuffixTo: [/\.vue$/], transpileOnly: true },
52
- },
53
53
  isDev && {
54
54
  test: isTs ? paths_js_1.default.vueTsEntryFile : paths_js_1.default.vueJsEntryFile,
55
55
  include: paths_js_1.default.appSrc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "0.0.4",
3
+ "version": "1.0.0-rc.1",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -15,8 +15,8 @@
15
15
  "@babel/preset-react": "^7.14.5",
16
16
  "@babel/preset-typescript": "^7.15.0",
17
17
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
18
- "@tuya-sat/micro-dev-loader": "0.0.4",
19
- "@tuya-sat/micro-dev-proxy": "0.0.4",
18
+ "@tuya-sat/micro-dev-loader": "1.0.0-rc.1",
19
+ "@tuya-sat/micro-dev-proxy": "1.0.0-rc.1",
20
20
  "babel-loader": "^8.2.2",
21
21
  "babel-plugin-import": "^1.13.3",
22
22
  "copy-webpack-plugin": "^9.0.1",
@@ -38,7 +38,6 @@
38
38
  "sass-loader": "^12.1.0",
39
39
  "style-loader": "^3.3.0",
40
40
  "svg-url-loader": "^7.1.1",
41
- "ts-loader": "^9.2.6",
42
41
  "tsconfig-paths-webpack-plugin": "^3.5.1",
43
42
  "url-loader": "^4.1.1",
44
43
  "vue-loader": "16.8.2",
@@ -57,5 +56,6 @@
57
56
  "saas",
58
57
  "cloud",
59
58
  "tuya"
60
- ]
59
+ ],
60
+ "stableVersion": "0.0.4"
61
61
  }