5

在 Electron-React-Typescript 应用程序中,我收到此错误:

Automatic publicPath is not supported in this browser

package.json 中的 devDependencies :

"css-minimizer-webpack-plugin": "^1.2.0",
"electron": "^11.2.3",
"typescript": "^4.1.5",
"webpack": "^5.21.2",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2"

按照此处的指示:此浏览器不支持 Webpack5 Automatic publicPath

webpack.rules.config.js :

// Images Loader
test: /\.(gif|jpe?g|tiff|png|webp|bmp)$/,
use: [
  {
    loader: 'file-loader',
    options: {
      //publicPath: '',
      publicPath: inDev ? 'images' : './main_window/images',
      outputPath: inDev ? 'images' : './main_window/images',
    },
  },

我尝试将 publicPath 设置为空并填充 outputPath 的值。还删除了 mini-css-extract-plugin。但这些都不起作用。

有什么建议么?

4

0 回答 0