On 10/06/19 20:03, Paolo Greppi wrote:
...
Tomorrow I'll test the generated file inside laminar. If that works this is an 
acceptable solution.
The last bit is to move this config change to debian/rollup-umd.js so that it 
does not impact all builds..

Paolo


I tested with the non-minified file generated using the patched build/config.js 
and this command:
NODE_PATH=debian/node_modules/ rollup -m -c debian/rollup-umd.js
but when opening the laminar dashboard I get a new error:

vue-router.min.js:1195 Uncaught TypeError: Cannot read property 'forEach' of 
undefined
    at compileRouteRegex (vue-router.min.js:1195)
    at addRouteRecord (vue-router.min.js:1112)
    at vue-router.min.js:1061
    at Array.forEach (<anonymous>)
    at createRouteMap (vue-router.min.js:1060)
    at createMatcher (vue-router.min.js:1274)
    at new VueRouter (vue-router.min.js:2374)
    at app.js:796

Not sure if this is due to some path-to-regexp API change.

Anyway that code is skipped for the minified version:
https://salsa.debian.org/js-team/vue-router.js/blob/master/src/create-route-map.js#L156

so I tested the file generated with:
NODE_PATH=debian/node_modules/ rollup -m -c debian/rollup-umd-min.js

and the JavaScript now works apart from some missing CSS and vue is in dev mode 
(see attached screenshot)

So I confirm that the way to go to fix the issue with libjs-vue-router minified 
UMD build is to enable rollup-plugin-node-resolve.
The proposed config change should be moved from build/config.js to 
debian/rollup-umd*.js so that it does not impact the other builds.

But the dev mode, minified UMD build would be affected by the exception above, 
generated in compileRouteRegex function.

Paolo
-- 
Pkg-javascript-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to