推送项目重构代码
This commit is contained in:
@@ -79,6 +79,19 @@ module.exports = {
|
||||
config.plugins.delete('preload') // TODO: need test
|
||||
config.plugins.delete('prefetch') // TODO: need test
|
||||
|
||||
// 修补 OpenIM SDK 里 webpack4 不识别的 import.meta.url 语法
|
||||
// 把 import.meta.url 替换成 self.location.href(worker 模块加载时同样有效)
|
||||
config.module
|
||||
.rule('openim-patch')
|
||||
.test(/@openim[\\/]wasm-client-sdk[\\/]lib[\\/].+\.js$/)
|
||||
.use('string-replace-loader')
|
||||
.loader('string-replace-loader')
|
||||
.options({
|
||||
multiple: [
|
||||
{ search: 'import\\.meta\\.url', replace: 'self.location.href', flags: 'g' }
|
||||
]
|
||||
})
|
||||
|
||||
// set svg-sprite-loader
|
||||
config.module
|
||||
.rule('svg')
|
||||
|
||||
Reference in New Issue
Block a user