From a116b9e802f49d3396548902aff8e8489444ee85 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Wed, 9 Mar 2022 16:31:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0webpack=E5=AF=B9=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E3=80=81=E5=AA=92=E4=BD=93=E8=B5=84=E6=BA=90=E7=9A=84?= =?UTF-8?q?=E6=89=93=E5=8C=85=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laibo102 Change-Id: I03ea41d013b7a437dd94f07276b18ea8c16ec8c7 (cherry picked from commit 363c20481005f76bdcc7ab0c13ef942c903abbd2) Signed-off-by: laibo102 --- compiler/package-lock.json | 21 +++++++++++++++++++++ compiler/package.json | 4 +++- compiler/tsconfig.json | 2 +- compiler/webpack.config.js | 6 ++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 5185b36..2359360 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -2507,6 +2507,16 @@ "flat-cache": "^3.0.4" } }, + "file-loader": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/file-loader/-/file-loader-6.2.0.tgz", + "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.nlark.com/fill-range/download/fill-range-7.0.1.tgz", @@ -4093,6 +4103,17 @@ "punycode": "^2.1.0" } }, + "url-loader": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/url-loader/-/url-loader-4.1.1.tgz", + "integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "mime-types": "^2.1.27", + "schema-utils": "^3.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Futil-deprecate%2Fdownload%2Futil-deprecate-1.0.2.tgz", diff --git a/compiler/package.json b/compiler/package.json index 7365713..ca43b92 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -28,11 +28,13 @@ "@typescript-eslint/parser": "^4.11.0", "chai": "^4.2.0", "eslint": "^7.16.0", + "file-loader": "^6.2.0", "mocha": "^8.2.1", "mocha-context": "^0.1.5", "ts-node": "^9.1.1", "uglify-js": "^3.13.0", - "pegjs": "^0.10.0" + "pegjs": "^0.10.0", + "url-loader": "^4.1.1" }, "dependencies": { "clean-webpack-plugin": "^3.0.0", diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index b53c39d..93b298b 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -553,7 +553,7 @@ "sourceMap": true, "module": "commonjs", "target": "es2017", - "types": [], + "types": ["node"], "typeRoots": [], "lib": [ "es2020" diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 8cf334f..36bbe93 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -59,6 +59,12 @@ function initConfig(config) { mode: 'development', module: { rules: [ + { + test:/\.(jpg|png|gif|jpeg|mp3|mp4)$/, + use:{ + loader:'url-loader' + } + }, { test: /\.d\.ts/, loader: 'ignore-loader' From 3ef8db9802cfb5c63279fcc9e9ed7f33eef55fcb Mon Sep 17 00:00:00 2001 From: laibo102 Date: Sun, 13 Mar 2022 09:47:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fixbug:=20tsconfig=20=E4=B8=AD=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E2=80=98node=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laibo102 Change-Id: I545cd785003f8aa5a6e316110ea9292f0b39d5dc (cherry picked from commit e072c174bb06f15037aad4449efdd6f37f801034) Signed-off-by: laibo102 --- compiler/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index 93b298b..b53c39d 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -553,7 +553,7 @@ "sourceMap": true, "module": "commonjs", "target": "es2017", - "types": ["node"], + "types": [], "typeRoots": [], "lib": [ "es2020" From 7965250513b67e03b54e2c332c29f55bd4916914 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Sun, 13 Mar 2022 17:14:33 +0800 Subject: [PATCH 3/3] add: .svg Signed-off-by: laibo102 Change-Id: I421880ec8b7e2e607fae5f90b2d384fdcb4a2e59 (cherry picked from commit 9455a97abec71a662673fa4a42d0864ffccbda6e) Signed-off-by: laibo102 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 36bbe93..10efa7a 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -60,7 +60,7 @@ function initConfig(config) { module: { rules: [ { - test:/\.(jpg|png|gif|jpeg|mp3|mp4)$/, + test:/\.(jpg|png|gif|jpeg|mp3|mp4|svg)$/, use:{ loader:'url-loader' }