
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@youyouzone/shader-loader
Advanced tools
Webpack loader for loading shader files.
Support "#include <filename.filetype>" to import exteral shader file.
Three.js support #include syntax to import exteral shader file listed in ShaderChunk file but not support custom shader file.
Shader-loader aims to share custom shader code between different shader files. If external shader file can not be found in the specificed file path, it won't do anything and let it handled by other library, like Three.js.
Assume your file structure like below.
src/
└── shaderchunk/
install npm package
npm i @youyouzone/shader-loader
set up webpack config
// webpack.config.js
const path = require('path');
module.exports = {
//...
module: {
rules: [
{
test: /\.(frag|vert|fragment|vertex|shader|glsl)$/,
use:[{
loader: '@youyouzone/shader-loader',
options:{
publicPath:'./src/shaderchunk', // folder of shader files, defautl is './'
}
}]
},
],
},
};
//also support multiple publicPath
module.exports = {
//...
module: {
rules: [
{
test: /\.(frag|vert|fragment|vertex|shader|glsl)$/,
use:[{
loader: '@youyouzone/shader-loader',
options:{
publicPath: [
'@youyouzone/shader-chunk', // from node_modules
'./src/shaderchunk'
],
}
}]
},
],
},
};
// vertexShader.vert
#include <myshader.glsl>;
This project is licensed under
FAQs
webpack loader for loading shader
The npm package @youyouzone/shader-loader receives a total of 1 weekly downloads. As such, @youyouzone/shader-loader popularity was classified as not popular.
We found that @youyouzone/shader-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.