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

Ben Finney bignose at debian.org
Sun Mar 4 21:55:02 UTC 2018


Pirate Praveen <praveen at onenetbeyond.org> writes:

> On March 4, 2018 2:56:53 PM GMT+05:30, Ben Finney <bignose at debian.org> wrote:
> >I have the ‘libjs-backbone’ package installed, and want to use it in
> >some JavaScript code via an ES6 ‘import’ statement.
>
> As far as I understand, you have to write code targeting nodejs […]

Thanks for the reply.

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.

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?

-- 
 \       “Corporation, n. An ingenious device for obtaining individual |
  `\       profit without individual responsibility.” —Ambrose Bierce, |
_o__)                                   _The Devil's Dictionary_, 1906 |
Ben Finney




More information about the Pkg-javascript-devel mailing list