
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
sky-vue-native-scripts
Advanced tools
Compile And Transform Vue component to React Native.
npm install --save vue-native-core vue-native-helper
npm install --save-dev vue-native-scripts
Add this to your rn-cli.config.js (make one to your project's root if you don't have one already):
module.exports = {
getTransformModulePath() {
return require.resolve("./vueTransformerPlugin.js");
},
getSourceExts() {
return ["vue"];
}
};
Create vueTransformerPlugin.js file to your project's root and specify supported extensions:
// For React Native version 0.52 or later
var upstreamTransformer = require("metro/src/transformer");
// For React Native version 0.47-0.51
// var upstreamTransformer = require("metro-bundler/src/transformer");
// For React Native version 0.46
// var upstreamTransformer = require("metro-bundler/build/transformer");
var vueNaiveScripts = require("vue-native-scripts");
var vueExtensions = ["vue"]; // <-- Add other extensions if needed.
module.exports.transform = function({ src, filename, options }) {
if (vueExtensions.some(ext => filename.endsWith("." + ext))) {
return vueNaiveScripts.transform({ src, filename, options });
}
return upstreamTransformer.transform({ src, filename, options });
};
For react-native packager can not bundle .vue file, this scripts just compiled the file with .vue suffixed and generated a same name file with .js suffixed.
In the react native application, you can simply import your Vue components as following
import VueComponent from './VueComponent.vue'
There should be a file named VueComponent.vue in the corresponding folder, and the transformer would be parse this file and send it to the react native packager.
FAQs
Compile Vue component to React Native
We found that sky-vue-native-scripts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.