timfish / forge-externals-plugin Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello,
I found out about this package via this issue from the ElectronForge page that I filed:
If you read down a bit, your plug-in fixes the case when I package a native dependency invoked from the main process. However, if I move the code to the renderer.ts
process, it cannot find serialport
(warning from the browser); nor if I import serialport from a forked process from main, it also cannot find it (no native module exists...).
I only filed an issue with a simple bug because my main application is several years old and has grown quite a bit, but I can include portions if it would help you debug?
E.g., my webpack.main.config.js
contains this:
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: {
'index': './src/main/index.ts',
'worker-thread': './src/framework/worker-thread.ts',
'worker-thread-lpm01a': './src/framework/device-manager/lpm01a/worker-thread.ts'
},
output:{
filename: '[name].js',
},
module: {
rules: require('./webpack.rules'),
},
// Need this so that we can build "worker-thread" which has Vue/Pug in it
plugins: plugins,
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
},
externals: {
serialport: "serialport",
}
};
And as you can probably guess, worker-thread-lpm01a
is forked from worker_thread
, which is forked from index
(main) and then imports serialport
.
Hi,
I want to use the plugin with a @Scoped native package. In this case, it does not work. yarn start works fine but the packaged version does not contain the scoped native package.
Thanks.
Hi,
I'm using electron-forge 6.1 with webpack and native modules.
I found my native module doesn' t included in the package, so I installed this plugin.
It was loaded but does nothing.
I read Writing Plugins and turned out that getHook may be deprecated and changed to getHooks. Changing getHook to getHooks as follows fixed the probrem.
getHooks() {
return {
resolveForgeConfig: this.resolveForgeConfig,
};
}
This is very tiny change, so I write to here. If you prefer, I can send a PR.
Best regards,
I found an cenario where scoped subdependencies of serialport(Eg: @serialport/parser-byte-length) wasn't included on node_modules after forge package.
Please review the change adding the split case of foundModules so we could publish an fix version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.