commonjs

    0热度

    1回答

    我们正在研究带有helpers(Dust.js)的模板库,该辅助库在代码库中具有以下设计模式。 (function(root, factory) { if (typeof define === 'function' && define.amd && define.amd.dust === true) { define(['dust-linkedin'], factory);

    0热度

    1回答

    在此tutorial笔者使用此代码举例出口代码: // sum.js var sum = function (a, b) { return a + b; }; module.exports = sum; 但是这是否错了?我以为module.exports是一个对象,你想分配的sum给它的键和功能的value它类似于像这是什么其他article一样 - // greetings.j

    0热度

    2回答

    我尝试使用下面的链接 https://blog.risingstack.com/node-js-at-scale-module-system-commonjs-require/ 我收到错误文件未找到错误为什么实现CommonJS的彭定康,而为什么需要需要扩展名为.js? 这里是我的代码 https://plnkr.co/edit/mYeCYw9MOr87b4dQZr5I?p=preview 错误出

    0热度

    1回答

    WebPack遇到问题。我有一个供应商库(称为ChildVendor),它实现requireJS和commonJS兼容性,所以我需要在我的WebPack项目中需要它,如var lib = require('./childVendor');。这ChildVendor库具有依赖性(话说SuperVendor),且二者都requirejs-和CommonJS的适应,如此,childVendor.js的标

    0热度

    1回答

    我试图让汇总,commonjs,es6和树木摇晃正常工作。 目前,我有以下构建脚本: 'use strict'; const rollup = require('rollup'); const resolve = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs')

    0热度

    1回答

    我完全不熟悉模块化JS,从未使用过任何模式。我正在编写一个项目,它有400多行代码,我希望通过分离不同模块中的内容来更好地管理它。我选择使用commonJS模块,因为我已经使用了webpack。现在,我在不同的模块的推杆我的第一个功能,并远销这样说:在我的主JS文件 //init.js file var initt = function() { octaveNumber = docum

    2热度

    1回答

    的WebPack生成以下定义UMD预计在什么环境: (function webpackUniversalModuleDefinition(root, factory) { // this is CommonJS/Node if(typeof exports === 'object' && typeof module === 'object') module.expo

    0热度

    1回答

    我有React应用程序和一个文件,我想存储与api相关的东西。 const proxy = require('http-proxy-middleware'); const path = require('path'); //..... const targetApi = (objectWithUrlEntries) => { Object.keys(objectWithUrlE

    0热度

    1回答

    我想添加一个测试,它将覆盖CommonJS文件module1.js中的返回语句,请参阅附加图像。 这里就是我目前正试图: describe("Module 1 ",() => { let mod, testMod = null; beforeEach(() => { mod = { module1: require('../src/app/js/mo

    0热度

    1回答

    我想要正确呈现“重新加载”github按钮,当我按另一个按钮时。我搜索,我得到this information,但我不能这样做,我面临的另一个错误: Uncaught Error: Module name "github-buttons" has not been loaded yet for context: _. Use require([]). 当我包括http://requirejs.or