|
|
@@ -67,6 +67,12 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
},
|
|
|
webpackChain(chain) {
|
|
|
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
|
|
+
|
|
|
+ // 定义 globalThis 全局变量,解决 npm 包中缺少 typeof globalThis === 'undefined' 判断的问题
|
|
|
+ chain.plugin('define-globalThis').use(require('webpack').DefinePlugin, [{
|
|
|
+ 'globalThis': '(typeof globalThis !== "undefined" ? globalThis : {})'
|
|
|
+ }])
|
|
|
+
|
|
|
chain.merge({
|
|
|
plugin: {
|
|
|
install: {
|
|
|
@@ -76,7 +82,7 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
cssSelectorReplacement:{
|
|
|
universal: ['view','text','button', 'input']
|
|
|
},
|
|
|
- cssChildCombinatorReplaceValue: ['view', 'text', 'button', 'input']
|
|
|
+ cssChildCombinatorReplaceValue: ['view', 'text', 'button', 'input']
|
|
|
}]
|
|
|
}
|
|
|
}
|