nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron
https://nklayman.github.io/vue-cli-plugin-electron-builder/
MIT License
4.12k stars 280 forks source link

externals can not be removed even if experimentalNativeDepCheck is enabled #1872

Open bruceauyeung opened 1 year ago

bruceauyeung commented 1 year ago

Describe the bug the following error would rise when yarn build if externals being removed:

        ERROR  Failed to compile with 1 error17:23:27

        error  in ./node_modules/react-screenshots/dist/index.html

        Module parse failed: Unexpected token (1:0)
        You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
        > <!doctype html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link href="css/app.c638c105275b2bc6ebc6.css" rel="stylesheet"></head><body><noscript><strong>很抱歉,没有JavaScript,网站不能正常工作。请启用JavaScript。</strong></noscript><div id="app"></div><script src="js/app.b2ecc57be74465245baf.js"></script></body></html>

        @ ./node_modules/electron-screenshots/lib/screenshots.js 348:29-81
        @ ./src/windowManager.ts
        @ ./src/auth/uacAuth.ts
        @ ./node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--15-3!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=ts&
        @ ./src/App.vue?vue&type=script&lang=ts&
        @ ./src/App.vue
        @ ./src/main.ts
        @ multi ./src/main.ts

        ERROR  Vue CLI build failed. Please resolve any issues with your build and try again.

related configurations:

externals: ['ffi-napi', 'ref-napi', 'sharp', 'electron-screenshots', 'mmap-io', 'shmmap', 'node-screenshots'],
experimentalNativeDepCheck: true,

To Reproduce Steps to reproduce the behavior:

Expected behavior externals can be removed when experimentalNativeDepCheck is enabled

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):


**Additional context**
vcpeb: ^3.0.0-alpha.4
MatthijsBurgh commented 1 year ago

Have a look at https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/861. I don't have the time to take a look into it for now.