[Pkg-javascript-devel] Problems to recreate minimized JS in r-cran-jsonld

Andreas Tille tille at debian.org
Thu May 10 22:45:41 BST 2018


Hi David,

On Thu, May 10, 2018 at 02:42:29PM -0400, David I. Lehn wrote:
> On Wed, May 9, 2018 at 5:35 AM, Andreas Tille <andreas at fam-tille.de> wrote:
> > I was stumbling upon an issue with some minimized JS in the package
> > r-cran-jsonld (ITPed in #898224).  I tried to recreate jsonld.min.js and
> > have written a script[1] which calls webpack in a clone of the Github
> > reporsitory.  Unfortunately the webpack call ends in:
> >
> > webpack-merge at 4.1.2 node_modules/webpack-merge
> > └── lodash at 4.17.10
> > ...
> >     ERROR in multi regenerator-runtime/runtime core-js/fn/array/includes core-js/fn/object/assign core-js/fn/promise core-js/fn/string/starts-with core-js/fn/symbol ./lib/index.js
> >     Module not found: Error: Can't resolve 'babel-loader' in '/home/andreas/debian-maintain/salsa/r-pkg-team/0_prospective/r-cran-jsonld/debian/JS/jsonld.js'
> >      @ multi regenerator-runtime/runtime core-js/fn/array/includes core-js/fn/object/assign core-js/fn/promise core-js/fn/string/starts-with core-js/fn/symbol ./lib/index.js
> > ...
> > Any idea how to get the minimized JS?  Simply taking the non-minimized
> > jsonld.js does not work.  The file size of this uncompressed file is way
> > smaller than the minimazion result and doese not work together with the
> > R code.  Thus I really need to undergo the process to create the
> > minimized JS.
> >
> > Any idea how to approach this?
> > ...
> > [1] https://salsa.debian.org/r-pkg-team/r-cran-jsonld/blob/master/debian/JS/get-jsonld.min
> >
> 
> Hi, I'm an upstream developer for jsonld.js and the one to blame for
> the webpack config. ;-)

Thanks a lot for stepping in here.

> I'm getting 404 on that salsa repo so I'm not
> sure what your script is doing.

I re-checked the link and I guess it was just a temporary error.

> In npm world you can build
> jsonld.min.js with "npm install && npm run build-webpack".  That's how
> it's published to npm.

This works for me now.

> I've never tried building with apt installed
> modules.  If upstream changes would help make this all easier, let me
> know.

While your hint was sufficient for me to get the compressed JS out of
the JS sources you might like to have a look at

   https://salsa.debian.org/r-pkg-team/r-cran-jsonld/tree/a5535fdc49edb0584c774f224c1bc23ff76810f0/debian/JS

There is the error

   https://salsa.debian.org/r-pkg-team/r-cran-jsonld/blob/a5535fdc49edb0584c774f224c1bc23ff76810f0/debian/JS/get-jsonld.min.err

if I try to build via

   webpack --config ../webpack.config.js lib/jsonld.js dist/jsonld.js --output-library=jsonld

No idea whether there is some hidden bug in the JS code.

Kind regards

        Andreas.

-- 
http://fam-tille.de



More information about the Pkg-javascript-devel mailing list