Open Jeromy-L opened 3 years ago
did you mean cjs
(commonjs) ?
No,cmd Such as seajs
------------------ Original ------------------ From: Emil Ajdyna <notifications@github.com> Date: Fri,Dec 4,2020 4:04 PM To: buxlabs/amd-to-es6 <amd-to-es6@noreply.github.com> Cc: Jeromy <843755624@qq.com>, Author <author@noreply.github.com> Subject: Re: [buxlabs/amd-to-es6] can transform cmd to es6? (#127)
hey @Jeromy-L
I haven't heard of cmd
before, but it seems to look similar to simplified commonjs wrapping pattern, I have some specs for that.
https://github.com/buxlabs/amd-to-es6/blob/b74da71937677675eace536192e5e50d68a50bf2/test/fixture/amdjs-api/simplified-commonjs-wrapping/input.js https://github.com/buxlabs/amd-to-es6/blob/b74da71937677675eace536192e5e50d68a50bf2/test/fixture/amdjs-api/simplified-commonjs-wrapping-returns-literal/input.js
Examples from this page should be supported.
I'd recommend to just try it out on your project and see how it goes.
hey @Jeromy-L
I haven't heard of
cmd
before, but it seems to look similar to simplified commonjs wrapping pattern, I have some specs for that.https://github.com/buxlabs/amd-to-es6/blob/b74da71937677675eace536192e5e50d68a50bf2/test/fixture/amdjs-api/simplified-commonjs-wrapping/input.js https://github.com/buxlabs/amd-to-es6/blob/b74da71937677675eace536192e5e50d68a50bf2/test/fixture/amdjs-api/simplified-commonjs-wrapping-returns-literal/input.js
Examples from this page should be supported.
I'd recommend to just try it out on your project and see how it goes.
i found that amd has such example, but you have not convert this one:
require([module], callback);
@Jeromy-L could you please provide a full example? That would make it easier to add a new unit test for that case.
@Jeromy-L could you please provide a full example? That would make it easier to add a new unit test for that case.
such as require(['myModule'], function(myModule) { myModule.dosomthing() });
can it also transform cmd to es6?