arqex / amdrequire Goto Github PK
View Code? Open in Web Editor NEWRequire AMD modules in Node.js as native modules.
License: BSD 2-Clause "Simplified" License
Require AMD modules in Node.js as native modules.
License: BSD 2-Clause "Simplified" License
It seems that one use-case (fairly common I would say) does not work. If you configure amdrequire with a path that is a common entry point to multiple modules, I don't see how this would work (actually doesn't). Consider this config option:
require.config({
basePath: __dirname + '/my/real/base',
paths: {
'common': 'libs/my/v1.0.0/debug'
}
});
then my require call would be something like this:
require(['common/js1', 'common/js2'], function(j1, j2){
....
}
});
My real dir structure looks like this:
__dirname/my/real/base/libs/my/v1.0.0/debug
|--js1.js
|--js2.js
How would you load js1 and js2?
Looks like it's expecting request to be a string, but it's not.
TypeError request.substring is not a function TypeError: request.substring is not a function
at Function.Module._resolveLookupPaths (module.js:214:23)
at Function.Module._resolveFilename (module.js:327:31)
at Function.Module._load (module.js:287:25)
at noderequire (/home/jon/ipython/ipywidgets/node_modules/amdrequire/amdrequire.js:10:17)
at /home/jon/ipython/ipywidgets/node_modules/amdrequire/amdrequire.js:54:5
at Array.forEach (native)
at amdrequire (/home/jon/ipython/ipywidgets/node_modules/amdrequire/amdrequire.js:37:8)
at define (/home/jon/ipython/ipywidgets/node_modules/amdrequire/amdrequire.js:115:10)
at Object.<anonymous> (/home/jon/ipython/ipywidgets/examples/development/embeding/node_modules/ipywidgets/ipywidgets/static/widgets/js/manager-base.js:4:1)
at Module._compile (module.js:435:26) [TypeError: request.substring is not a function]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.