On Thu, May 14, 2020 at 5:30 pm, Jonas Smedegaard <jo...@jones.dk> wrote:
No, fails.

The package now checks unit tests during build, and switching to Babel 7
causes one of those to fail:

not ok 69 Log suppression "before each" hook for "does not call console.log by default"
  Cannot find module ./utils

I think it is a bug in node-browserify-lite (that is cannot handle code generated by babel 7). I can see utils.js is present in dist but it did not get bundled correctly. I could get the tests to pass when using webpack instead of browserify-lite.

With debian/webpack.config.js,

'use strict';
var path = require('path');
var config = {
 target: 'node',
 resolve: {
        modules: ['/usr/share/nodejs', '/usr/lib/nodejs'],
 },
 resolveLoader: {
        modules: ['/usr/share/nodejs'],
 },
 output: {
   libraryTarget: 'umd'
 },
 module: { rules: [ { use: [ 'babel-loader' ] } ] }
}
module.exports = config;

and calling webpack --config debian/webpack.config.js -n adapter -f umd dist/adapter_core5.js -o out/adapter.js

has passing tests. I have pushed my rough changes in babel7 branch. I don't use babel-loader here (just copied an old configuration), may be you can use babel-loader and pass src/js directly to webpack instead of babeljs.

Reply via email to