1

I need to handle GLTF and HDR files in my Vue/Three.js application. This doesn't work out of the box with Vite. With Webpack I can set this in the Webpack config

module.exports = {
  module: {
    rules: [
      {
        test: /\.(gltf)$/i,
        use: [
          {
            loader: 'url-loader',
          },
        ],
      },
    ],
  },
};

Is there a way to do the same in Vite?

Robin-Whg
  • 263
  • 4
  • 14

1 Answers1

1

Seems like Vite can handle this out of the box. The problem was the cors settings of the server the files were on.

Robin-Whg
  • 263
  • 4
  • 14