且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用webpack +渲染图像?

更新时间:2023-11-10 20:27:34

这花了一些时间但似乎我需要增加字节限制才能使其工作。

This took some time but It would seem that I needed to increase the byte limit to get this to work.

我还通过@OlivierBoissé通过链接将webpack confic更改为建议者

I also changed the webpack confic to as suggester by @Olivier Boissé via the link

test: /\.(jpe?g|png|gif|svg)$/i,
loader: "file-loader?name=/public/images/[name].[ext]",
options: {
  limit: 100000,
},

以及以下内容:

  output: {
    path: path.resolve(__dirname, "dist"),
    publicPath: "/dist/",
    filename: "bundle.js",
  },