native modules该怎么理解?

native modules该怎么理解?

问题描述

今天在学习Vue-cli-plugin-electron时,发现Native modules,直译过来为:本地模块 或者 原生模块,但是不是很理解准确的意思,是不是npm install下载下来的modules都可以认为是Native modules?

补充描述

以下是官方文档:
Native modules are supported and should work without any configuration, assuming nodeIntegration is enabled. If you get errors, you may need to set the native dependency as an webpack external (opens new window). It should get found automatically, but it might not. To do this, use the externals option:

// vue.config.js

module.exports = {

pluginOptions: {

electronBuilder: {

// List native deps here if they don't work

externals: ['my-native-dep'],

// If you are using Yarn Workspaces, you may have multiple node_modules folders

// List them all here so that VCP Electron Builder can find them

nodeModulesPath: ['../../node_modules', './node_modules']

}

}

}


回答:

原生模块的意思是Node原生模块
https://www.electronjs.org/zh...

以上是 native modules该怎么理解? 的全部内容, 来源链接: utcz.com/p/936677.html

回到顶部