[Pkg-javascript-devel] ES6 ‘import’ of Debian-installed module
Pirate Praveen
praveen at onenetbeyond.org
Tue Mar 6 06:14:07 UTC 2018
On ചൊവ്വ 06 മാർച്ച് 2018 08:29 രാവിലെ, Ben Finney wrote:
> I believe this configuration just relies on Webpack and NodeJS to figure
> out the path resolution:
>
> =====
> $ cat webpack.config.js
> "use strict";
> const path = require('path');
> module.exports = {
> entry: './source/foo.js',
> output: {
> path: path.resolve(__dirname, 'dist'),
> filename: 'app.js',
> },
> };
> =====
>
> Webpack simply fails to find ‘backbone’:
> So, either the defaults as installed by Debian are not sufficient for
> Webpack to resolve the path of an installed NodeJS library; or I have
> misunderstood what you say.
>
I had linked to an exact line of the sample configuration which you seem
to have missed.
resolve: {
modules: ['/usr/lib/nodejs', '.'],
},
resolveLoader: {
modules: ['/usr/lib/nodejs'],
},
webpack, like other node tools (grunt, gulp) does not recognize global
modules. So we need to provide this path manually. But we could make
this path default with a patch in debian like we did for grunt and gulp,
patches welcome.
-------------- 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/20180306/badfd651/attachment.sig>
More information about the Pkg-javascript-devel
mailing list