
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@jpweeks/gltf-loader
Advanced tools
A Webpack loader for glTF assets. Automatically bundles all referenced files.
A Webpack loader for glTF assets. Automatically bundles all referenced files.
This loader is based on MONOGRID/gltf-loader-2.
rules: [
// IMPORTANT: if you have a loader for Image files (you would, normally)
// you NEED to add an exclude option IN IT for GLTF images
{
// following is an example of YOUR loader config
test: /\.(png|jpe?g|gif)(\?.*)?$/,
// here I decided to put all my gltf files under a folder named 'gltf'
// so I added and exclude rule to my existing loader
exclude: /gltf/, // only add this line
// (etc)
loader: 'url-loader',
options: {
limit: 10000,
name: 'img/[name].[hash:7].[ext]'
}
},
// GLTF configuration: add this to rules
{
// match all .gltf files
test: /\.(gltf)$/,
loader: '@jpweeks/gltf-loader'
},
{
// here I match only IMAGE and BIN files under the gltf folder
test: /gltf.*\.(bin|png|jpe?g|gif)$/,
// or use url-loader if you would like to embed images in the source gltf
loader: 'file-loader',
options: {
// output folder for bin and image files, configure as needed
name: 'gltf/[name].[hash:7].[ext]'
}
}
// end GLTF configuration
]
// please notice the file and all its dependencies
// are under a folder named 'gltf' as per webpack config
import gltfFile from 'assets/gltf/some.gltf';
// per configuration only the GLTF json het embedded in the source
// .bin and .png images are processed and outputted by webpack
var loader = new GLTFLoader()
loader.parse(shieldGLTF, '', (gltf) => {
// here we go
let scene = gltf.scene
})
FAQs
A Webpack loader for glTF assets. Automatically bundles all referenced files.
The npm package @jpweeks/gltf-loader receives a total of 73 weekly downloads. As such, @jpweeks/gltf-loader popularity was classified as not popular.
We found that @jpweeks/gltf-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
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.