Npm Web包:从本地目录加载依赖项
Package.jsonNpm Web包:从本地目录加载依赖项,npm,webpack,npm-install,Npm,Webpack,Npm Install,Package.json "dependencies": { "axios": "^0.18.0", "lodash": "^4.17.5", "moment": "^2.22.0", "vue": "^2.5.2", "vue-router": "^3.0.1", "vuex": "^3.0.1", "my-module-1": "file:../modules/my-module-1", "my-module-2": "file
"dependencies": {
"axios": "^0.18.0",
"lodash": "^4.17.5",
"moment": "^2.22.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"my-module-1": "file:../modules/my-module-1",
"my-module-2": "file:../modules/my-module-2",
"my-module-3": "file:../modules/my-module-3"
},
如果我安装了依赖项,它将成功完成。但是,在mapnode\u modules
中,my-module-x
是一个快捷方式,这会导致babel loader出现奇怪的错误。如果我将模块复制粘贴到节点模块中
,它工作得非常好。在以前版本的webpack中,它们总是被复制的。现在正在使用Webpack3.6.0
因此,我的问题是:是否有其他方法可以定义package.json中的依赖关系,或者有一个插件可以将模块(从package.json)从另一个目录复制到node\u modules
,而无需创建快捷方式
"dependencies": {
"my-module": "file:a_map/my-module",
// a_map folder is on the same level as this package.json file
}
在以下设置中效果非常好:
Npm(6.12.0)
也许这有帮助