简体   繁体   English

将JSPM工作流程与Wordpress开发集成

[英]Integrating JSPM workflow with Wordpress development

Im trying to adopt JSPM as my package manager for Wordpress development but im failing at loading the main app file. 我试图采用JSPM作为我的Wordpress开发的程序包管理器,但无法加载主应用程序文件。

This is usually done with 通常用

  <script>
        System.import('./app');
  </script>

The problem im running into is that jspm fails to load this file, trying to load in context of the current browser path http://localhost:3000/shop/app.js instead of the file system context. 我遇到的问题是jspm无法加载此文件,试图在当前浏览器路径http://localhost:3000/shop/app.js的上下文而不是文件系统上下文中加载。

I've tried to adjust some of the jspm's configuration options but couldn't get it to work. 我试图调整jspm的一些配置选项,但无法正常工作。

Can you point in the right direction here? 您能在这里指出正确的方向吗?

When running on file:/// URLs, you need to set your baseURL to the current path. file:/// URL上运行时,需要将baseURL设置为当前路径。 This can be done with: 这可以通过以下方式完成:

System.config({ baseURL: '.' });

Either in your configuration file or in the page itself. 在您的配置文件或页面本身中。 Note that when you load pages on different path levels, this baseURL path needs to be adjusted so it may be advisable to specify it in the page itself. 请注意,当您在不同的路径级别上加载页面时,需要调整此baseURL路径,因此建议在页面本身中指定它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM