electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.41k stars 506 forks source link

[Bug]: Static resource files are lost after packing #3501

Open lixianbin1 opened 6 months ago

lixianbin1 commented 6 months ago

Pre-flight checklist

Electron Forge version

7.3.0

Electron version

29.0.1

Operating system

window 10

Last known working Electron Forge version

No response

Expected behavior

Static resources should be packaged correctly and not lost

Actual behavior

If you use electron-forge to package electron, you will lose .obj static files in the packaged file.

Steps to reproduce

I added threejs to electron and then I used electron-forge to package electron. However, .obj files will be lost in the packaged files

    var mtlLoader = new THREE.MTLLoader()
    var objLoader = new THREE.OBJLoader()
    mtlLoader.setPath('static/Map/obj/')
    mtlLoader.load('room1.mtl',function(materials){
        materials.preload();
        objLoader.setMaterials(materials)
    });
    objLoader.setPath('static/Map/obj/')
    objLoader.load('room1.obj',function(object){
        object.traverse(function(child) {
            if(child instanceof THREE.Mesh) {
            child.material.transparent=true;
            child.receiveShadow = true;
            child.castShadow = true;
            child.material.map = texture;
            }
        })
        object.position.set(-6,-6,6)
        object.transparent=true;
        object.opacity=0.5
        scene.add(object);
        renderer.render(scene,camera);
    },undefined,function(error){
        console.log(error)
    });

Additional information

No response

nfgaetest commented 6 months ago

I'm facing the same issue.

After updating to 7.3.0, resources/app folder has only .vite and node_modules and package.json. Other files in electron folder does not exist.