[英]Moved system.js file from jspm_packages to another folder, wont resolve packages in config
I have a weird scenario where I am using JSPM and Aurelia, and I have a custom route setup to redirect calls to a certain module to go to a local folder (within the project) 我使用JSPM和Aurelia时出现了一个奇怪的情况,并且我有一个自定义路由设置来将调用重定向到某个模块以转到本地文件夹(在项目内)
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*",
"blah": "../dist/commonjs/"
},
packages: {
"blah": {
"main": "index.js",
"map": {
"*": "**/*"
}
}
},
then in aurelia I do something like aurelia.plugin("blah");
然后在aurelia中,我做类似
aurelia.plugin("blah");
and that gets system.js
to resolve an index.js
file in dist/commonjs
and all works great then we bundle aurelia and some other stuff and that works fine however we have an issue checking in our jspm_packages folder so we need to have access to system.js outside of that folder so if I change: 这样就可以使
system.js
解析dist/commonjs
的index.js
文件,并且一切正常,然后我们将dist/commonjs
和其他内容捆绑在一起,并且效果很好,但是我们在jspm_packages文件夹中检查问题,因此我们需要访问该文件夹之外的system.js,因此如果我进行更改:
<script src="jspm_packages/system.js"></script>
(which works) to <script src="libs/system.js"></script>
<script src="jspm_packages/system.js"></script>
(可以工作)到<script src="libs/system.js"></script>
or some other dir it stops working and instead of resolving blah to dist/commonjs/index.js
it tries to resolve dist/commonjs/.js
, so its like it ignores the packages but I am a bit baffled as to how including the system.js
file from a different folder can change behaviour so much... 或其他目录,它停止工作,而不是解析
dist/commonjs/index.js
而是尝试解析dist/commonjs/.js
,因此就像它忽略了程序包一样,但是我对如何包括system.js
感到困惑来自其他文件夹的system.js
文件可以更改行为...
So odd thing, it appears there is a bug of sorts here, which can be seen in his issue: 奇怪的是,这里似乎有一个错误,可以在他的问题中看到:
https://github.com/systemjs/systemjs/issues/1160 https://github.com/systemjs/systemjs/issues/1160
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.