我一直在尝试在我的 Snowpack 应用程序中加载 HDR 文件(与 THREE.js 一起使用)。我能够加载 .jpg 文件,但我似乎无法加载 .hdr。
我试过使用snowpack-plugin-raw-file-loader
,但没有奏效。我能够导入 .md 文件和其他此类文件类型,但我无法特别导入 .hdr 文件。
甚至有可能这样做吗?
我的 snowpack.config.mjs 文件
// Snowpack Configuration File
// See all supported options: https://www.snowpack.dev/reference/configuration
/** @type {import("snowpack").SnowpackUserConfig } */
export default {
mount: {
public: { url: '/'},
js: { url: '/dist' },
},
plugins: [
/* ... */
[
'@snowpack/plugin-webpack',
{
/* see "Plugin Options" below */
},
],
["snowpack-plugin-raw-file-loader", {
exts: [".txt", ".md", ".svg", ".hdr"], // Add file extensions saying what files should be loaded as strings in your snowpack application. Default: '.txt'
}],
'@snowpack/plugin-postcss',
'@snowpack/plugin-sass'
],
packageOptions: {
/* ... */
// source:"remote"
},
devOptions: {
tailwindConfig: './tailwind.config.js',
},
buildOptions: {
/* ... */
},
};