Closed onsah closed 4 years ago
@onsah It seems good, but I noticed a problem during cytoscape registration that is sourced from Babel v6 usage. The problem is same with the one described here. I think Babel 6 changes the way it exports default, so it requires to add .default
while using extension as CommonJs module (let contextMenus = require('cytoscape-context-menus').default;
) which isn't desired to provide backward compatibility. Hence, we either can use a plugin like this, or we can write registration part by using CommonJS require
and module.exports
. Can you please search in more detail and apply the appropriate solution for this?
Sorry about that. I should have tested it. I did some research and best and simplest way seems to use es modules inside the project but only export as CommonJS module. From there webpack should handle other module definitions such as amd. I made the necessary changes so that it exports using module.exports
instead of export default
. I tested the library it works with require
in node js projects.
@onsah In this case, do we need babel-plugin-add-module-exports
in package.json?
@hasanbalci We don't. I have removed it right now.
This pull request adds webpack configuration and removes gulp file. Webpack bundles separate javascript files into one. Allowing the programmer to write more structured code while deploying single file. Babel plugin adds the ability to use modern js features too. Functionality of gulp replaced by npm commands.