简体   繁体   English

没有转换的SystemJS导入

[英]SystemJS import without transpiling

I have a script that I need to import which I cannot have wrapped in a System.register call. 我有一个我需要导入的脚本,我无法在System.register调用中包装。

Is it possible to do this? 是否有可能做到这一点?

Thanks. 谢谢。

You could tell babel to ignore the module: 您可以告诉babel忽略该模块:

config.js config.js

System.config({
  defaultJSExtensions: true,
  transpiler: "babel",
  babelOptions: {
    "ignore": [
      "github:*",
      "npm:*",
      "my/module/that/i/do/not/want/transpiled.js"
    ],
    ...

Not sure if this is exactly what you're looking for or whether the .js is needed. 不确定这是否正是您正在寻找的,或者是否需要.js

you can import the script using Globals 您可以使用Globals导入脚本

systemjs globals systemjs全局

The global format loads globals identically to if they were included via script tags but with some extra features including the ability to shim dependencies, set custom globals, and define the exports of the global module. 全局格式加载全局变量,如果它们是通过脚本标记包含的,但具有一些额外的功能,包括填充依赖项,设置自定义全局变量以及定义全局模块的导出。

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

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