From 70717f0f09ede8ece43212f375c8ba377e8b9edc Mon Sep 17 00:00:00 2001 From: huangjiandong Date: Wed, 28 Sep 2022 12:57:57 +0800 Subject: [PATCH 1/3] FIX: Uncaught ReferenceError: React is not defined refs: #32 --- babel.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 966e51e..0ffc4cb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -38,7 +38,7 @@ module.exports = (api) => { plugins: [require.resolve('react-refresh/babel')], }, production: { - presets: ['@babel/preset-react'], + presets: [['@babel/preset-react', { runtime: 'automatic', development: false }]], plugins: ['@babel/plugin-transform-react-constant-elements'], }, }, From 0d49b93aa7ccc6029e1ef7e6a6f0238d3842cfa2 Mon Sep 17 00:00:00 2001 From: huangjiandong Date: Wed, 28 Sep 2022 13:04:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?MOD:=20=E6=94=AF=E6=8C=81=E4=BB=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E6=96=B9=E7=BD=91=E7=AB=99=E6=98=BE=E7=A4=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/popup.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/popup.html b/public/popup.html index 71a24e1..ff0f14d 100644 --- a/public/popup.html +++ b/public/popup.html @@ -4,6 +4,7 @@ + <%= htmlWebpackPlugin.options.title %> From 9472b9357197ae1e2890172c3da97aa082f2972f Mon Sep 17 00:00:00 2001 From: huangjiandong Date: Wed, 28 Sep 2022 14:04:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?MOD:=20=E6=94=AF=E6=8C=81=20import=20styles?= =?UTF-8?q?=20=E6=96=B9=E5=BC=8F=E5=AF=BC=E5=85=A5=20sass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/configs/webpack.common.ts | 2 +- src/declaration.d.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/declaration.d.ts diff --git a/server/configs/webpack.common.ts b/server/configs/webpack.common.ts index d4ea4b5..97a3c38 100644 --- a/server/configs/webpack.common.ts +++ b/server/configs/webpack.common.ts @@ -18,7 +18,7 @@ function getCssLoaders(importLoaders: number) { { loader: 'css-loader', options: { - modules: false, + modules: true, sourceMap: true, importLoaders, }, diff --git a/src/declaration.d.ts b/src/declaration.d.ts new file mode 100644 index 0000000..dc0bcea --- /dev/null +++ b/src/declaration.d.ts @@ -0,0 +1,6 @@ +declare type StyleSheetModule = { [key: string]: string }; + +declare module '*.scss' { + const exports: StyleSheetModule; + export default exports; +}