How can I use babel-plugin-import with babel 5.x? - babeljs

I'm trying to use babel-plugin-import to import antd in an old project that uses babel-core#5.4.7 and babel-loader#5.1.2.
How can I get babel-plugin-import to work with current configuration? Or is there any older version of babel-plugin-import plugin that would go with it?

Babel 5's plugin system was very different from Babel 6's, so it is unlikely that any current plugins will work on Babel 5.

Related

Is there a way to convert flutter package to plugin?

I have a Package made a while ago but I want to add some Android specific code (Java, but this doesn't matter). The only approach I currently have is just creating a new Plugin and moving things around from the old package to the new plugin.
Is there another way I'm missing?
Maybe a command line prompt or another tool?
Note for the differences between Package and Plugin from flutter.dev

Customize babel configuration in project created using create-react-app

I want to use a babel plugin (babel-plugin-module-resolver) in a project created using create-react-app.
I know how to change babel configuration using npm run eject, but I would like to avoid it.
I was going to use react-app-rewired but I heard that there is the possibility to configure babel without ejecting and without additional libraries.
(if possible), how can I do it?

Add Ionic 3 Plugin from Github Fork

I want to add a plugin from a github fork of the InAppBrowser. This is the fork I want to use. I know how to add the plugin. I simply use Ionic Cordova plugin add https://github.com/al1lhomme/cordova-plugin-inappbrowser
But how can I import it to the modules.ts? I think it is necessary to add it to npm correct? I think I have to install the npm module to import it in my modules.ts file.
I tried to use cordova.plugins.InAppBrowser but it doesn't work.
Thanks to everyone.
You never add the Plugin to the Module. What you add to the Modules.ts is the native Wrapper from Ionic. You can use Plugins without this Wrapper, but they are developed for an easier use. I don't know if they work with Forks, normally they are developed to work with the original plugin.
So try to just add the Plugin via
ionic cordova plugin add path_to_fork
And use it without the Wrapper, as described in the Plugins Read Me

How to create a babel plugin for internal use

How do we use a babel plugin that is not already accepted in a babel repository? I had trouble finding this answer reading through the babel plugin documentation.
We are interested in writing a babel plugin for for...in loops to address a bug in ios9 (ios9 Safari miscalculating sum). Although we would be happy to contribute it to the babel community, I was also wondering if it doesn't get accepted or isn't ready for general consumption, how to start using and testing it locally.
It's possible to make use of custom babel plugins that you can host on git.
You can refer to https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md for learning how you can develop and test your babel plugin locally.
Once you have developed the plugin, you can add a dependency for it in your project's package.json file.
Note that if you plan to make the plugin repository private, you'd have to create a personal access token (for Github) to allow npm to fetch repository contents. In that case, the example entry in your package.json file would be as follows:
"babel-plugin-transform-for-of-loop": "git+https://{token}:x-oauth-basic#github.com/username/babel-plugin-transform-for-of-loop"
Whatever package name that you pick for your plugin, you will need to add a reference for it in the .babelrc file. For this example, it would be as follows:
{
...
"plugins": [
"babel-plugin-transform-for-of-loop"
]
}
With that done, you should simply run npm install and your plugin would become active for your project.

Unable to add CordovaLib as a target dependency

I'm trying to the the phoneGap framework as a library, there is something called CordovaLib which suppose to support it. here are the instractions http://docs.phonegap.com/en/2.0.0/guide_cordova-webview_ios.md.html
I followed the steps completely, however on step 23 I can't find the CordovaLib to add, and if I skip it I can't import the CDVViewController.
It looks like a basic Xcode configuration issue, Can anyone help me with that?
[Update] i've installed 1.9.0 and it works fine. they did some changes in the way they link the Lib in 2.0.0 and change the instructions accordingly however it doesn't seem to work.
I have had trouble with adding the target dependency as well.
One possible workaround is to open the CordovaLib project and build. This will create the CordovaLib.a library that you need to replace the pre 2.0 framework. You can then copy that library into your project and add it as a library dependency in the build phase area.