Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@d2c2d/config-plugin

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d2c2d/config-plugin

# create file .configPlugin.json

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
-71.43%
Maintainers
0
Weekly downloads
 
Created
Source

inject some json config to app

create file .configPlugin.json


{
    "tradeScopeConfig": {
        "trade1": "btc"
    },
    "walletScopeConfig": {
        "address": "test"
    }
}

config babel.config.js or other babel config


module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      [
        'module:@d2c2d/config-plugin',
        {
          // moduleName: '@ConfigPlugin',
          // path: '.configPlugin.json',
          verbose: false,
        },
      ],
    ],
  };
};


import scopeValue

 import {tradeScopeConfig} from "@ConfigPlugin"
 
console.log("tradeScopeConfig:", tradeScopeConfig)

rn project metro config


// metro.config.js
const {getFilesHash} = require("@d2c2d/config-plugin")

const projectRoot = __dirname;

const config = getDefaultConfig(projectRoot, {
  // Disable CSS support.
});
config.cacheVersion = getFilesHash([".configPlugin.json"])


FAQs

Package last updated on 23 Jun 2024

Did you know?

Socket

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.

Install

Related posts