How to use the vue-native-scripts/src/util/constants.SCRIPT_OPTIONS function in vue-native-scripts

To help you get started, we’ve selected a few vue-native-scripts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github syumai / vue-native-custom-transformer-plugin / compiler / parsers / parseScript.js View on Github external
function parseScript(script) {
  if (!script) {
    return defaultScript;
  }

  const scriptContent = script.content.replace(/\/\/\n/g, '').trim();
  const s = `const ${constants.SCRIPT_OPTIONS} = `;
  return scriptContent
    .replace(/[\s;]*module.exports[\s]*=/, `\n${s}`)
    .replace(/[\s;]*export[\s]+default[\s]*\{/, `\n${s} {`);
}
github syumai / vue-native-custom-transformer-plugin / compiler / parsers / parseScript.js View on Github external
const defaultScript = `const ${constants.SCRIPT_OPTIONS} = {}`;
const constants = require('vue-native-scripts/src/util/constants');

function parseScript(script) {
  if (!script) {
    return defaultScript;
  }

  const scriptContent = script.content.replace(/\/\/\n/g, '').trim();
  const s = `const ${constants.SCRIPT_OPTIONS} = `;
  return scriptContent
    .replace(/[\s;]*module.exports[\s]*=/, `\n${s}`)
    .replace(/[\s;]*export[\s]+default[\s]*\{/, `\n${s} {`);
}

module.exports = parseScript;

vue-native-scripts

Compile Vue Native components to React Native

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages