-
1 votesanswersviews
angular2 deps 以外的导入会破坏 webapp 编译
在我的 angular 2 应用程序中,我遇到了导入除 angular 或我的应用程序组件之外的依赖项的问题。 (e.g. angular2-moment) 我有<base href="/"> 应用程序通过 main 运行(compilation.js 包含所有应用程序模块): <script src="/app/compilation.js&quo... -
1 votesanswersviews
简单的Babel编译es6模块加载
我正在寻找由babel编译的导入/导出es6模块的简单模块加载 . 从带有导入/导出模块的es6源文件开始,以便在浏览器中使用 使用babel将此静态转换为es5,配置指定最简单的模块转换(amd,commonjs,systemjs) . 不要将npm用于模块,也不要使用任何其他复杂的工作流程 . 只是babel转换文件 . 使用模块加载这些es5文件,使用 <script&... -
1 votesanswersviews
SystemJS - ES6模块加载器 - 导入过多的层次结构
我刚刚开始使用SystemJS和ES6模块加载器 . 我有一个简单的测试模块: var Feature = { init : function(){ console.log("Feature.init"); } }; export {Feature}; 然后导入 System.import('js/feature.js').then(funct... -
2 votesanswersviews
ES6 SystemJs - 为什么我必须使用.js扩展名来导入es6模块?
为什么我必须使用.js扩展名来导入带有systemjs的es6模块?例如: import { multiplier } from "adder.js"; // ok import { double, square } from 'modules'; // error var timesTwo = multiplier(2); console.log(timesTwo(4))... -
3 votesanswersviews
使用SystemJS加载模块时如何摆脱“默认”属性?
我有一个AMD module,我想用SystemJS加载 . 我能够做到这一点,但不幸的是我必须这样称呼它: var Logdown = module.default; var instance = new Logdown('Test'); 我想跳过打电话 .default ,但我不知道如何摆脱这个属性 . 我认为这个 default 以某种方式由SystemJS加载器分配 . 这是我的模块: ... -
0 votesanswersviews
使用SystemJS加载捆绑的AMD模块
我有几个使用TypeScript的 --outFile 选项编译的AMD模块到一个文件中: define("partA", ["require", "exports"], function (require, exports) { "use strict"; function partAFunc() {... -
0 votesanswersviews
systemjs无法加载我的模块
systemjs.config.js: /** * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function (global) { System.config({ paths: { // paths serve as a... -
10 votesanswersviews
TypeError:__ webpack_require __ . i(...)不是函数
当我尝试简化导入时,我得到一个webpack TypeError . 以下代码无任何问题 . 这里我从 core/components/form/index.js 导入一个名为 smartForm 的React高阶组件(HOC) . core/components/form/index.js ( smartForm 的命名导出) export smartForm from './smart-for... -
206 votesanswersviews
将lodash导入angular2 typescript应用程序
我很难尝试导入lodash模块 . 我使用npm gulp设置我的项目,并继续击中同一面墙 . 我已经尝试过常规的lodash,还有lodash-es . lodash npm包:(包根文件夹中有一个index.js文件) import * as _ from 'lodash'; 结果是: error TS2307: Cannot find module 'lodash'. lodash-es... -
0 votesanswersviews
当ES6模块由SystemJs加载异步时,如何处理Kendo MVC事件绑定
由于SystemJs加载模块异步,您无法直接将事件绑定到html文件中 . 即使在System.import之后声明控件,此时所有函数都是未定义的 . 例如,以下内容不起作用: <script type="text/javascript"> System.import('myModule'); //myModule contains a function cal...