Shaders issue
Unanswered
West African Lion posted this in #help-forum
West African LionOP
hello, im trying to implement shaders into my nextjs project but ive got an issue with extension .glsl cuz it throws out error when importing (screenshot). ive already tried creating types file:
and customizing next.config.ts:
but it still throws out same error. any ideas how can i fix it?
declare module '*.glsl' {
const value: string
export default value
}
and customizing next.config.ts:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
webpack(config) {
config.module.rules.push({
test: /\.(glsl|vs|fs|vert|frag)$/,
use: 'raw-loader',
type: 'asset/source',
});
return config;
},
experimental: {
turbo: {
rules: {
'**/*.glsl': ['raw-loader']
},
},
},
};
export default nextConfig;
but it still throws out same error. any ideas how can i fix it?