无需转译的 SystemJS 导入
SystemJS import without transpiling
我有一个需要导入的脚本,我无法将其封装在 System.register 调用中。
可以这样做吗?
谢谢。
你可以告诉 babel 忽略模块:
config.js
System.config({
defaultJSExtensions: true,
transpiler: "babel",
babelOptions: {
"ignore": [
"github:*",
"npm:*",
"my/module/that/i/do/not/want/transpiled.js"
],
...
不确定这是否正是您要找的,或者是否需要 .js
。
您可以使用 Globals
导入脚本
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.
我有一个需要导入的脚本,我无法将其封装在 System.register 调用中。
可以这样做吗?
谢谢。
你可以告诉 babel 忽略模块:
config.js
System.config({
defaultJSExtensions: true,
transpiler: "babel",
babelOptions: {
"ignore": [
"github:*",
"npm:*",
"my/module/that/i/do/not/want/transpiled.js"
],
...
不确定这是否正是您要找的,或者是否需要 .js
。
您可以使用 Globals
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.