[Pkg-javascript-devel] ES6 ‘import’ of Debian-installed module

Pirate Praveen praveen at onenetbeyond.org
Mon Mar 5 11:08:56 UTC 2018


On തിങ്കള്‍ 05 മാർച്ച് 2018 03:25 രാവിലെ, Ben Finney wrote:
> My understanding, from <URL:https://webpack.js.org/concepts/modules/>
> the Webpack documentation about modules, is that it claims to support
> the ‘require’ modules (so-called “AMD modules”).
> 
> The ‘libjs-backbone’ package installs Backbone code that uses AMD-style
> ‘require’ dependencies.

I think you meant UMD (Universal Module) here. I think it is still
better to require/import just 'backbone' and let nodejs and webpack
handle the path resolution.

> So, when I write code that uses ‘import’ to bring in Backbone, and the
> Backbone code uses ‘require’ for its dependencies, that seems compatible
> with Webpack if I understand the Webpack documentation. Or am I missing
> something there?
> 

In this case, you just need to tell webpack to resolve dependencies from
/usr/lib/nodejs.

See
https://wiki.debian.org/Javascript/Nodejs#CA-55601b3ea46d08ca4081f3465bbf840faab73781_10

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/attachments/20180305/9a8e671b/attachment.sig>


More information about the Pkg-javascript-devel mailing list