0.0.5 • Published 2 years ago

react-native-web-config v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-web-config

npm version

react-native-config for Web.

Overview

Inspired by react-web-config

This repository purpose is to repair react-web-config not support webpack 3 or above version error.

Usage

$ npm i react-native-web-config

webpack.config.js

  const webpack = require('webpack');
+ const ReactNativeWebConfig = require('react-native-web-config/plugin');
+ const path = require('path');
+ /* .env is default name, if you set custom name please replace it */
+ const envFilePath = path.resolve(__dirname, '.env');
  module.exports = {
    ...
    plugins: [
      ...
+     /* define __REACT_NATIVE_WEB_CONFIG__ */
+     ReactNativeWebConfig(envFilePath)
    ],
    resolve: [
      alias: [
        ...
        'react-native': 'react-native-web',
+       /* set alias from react-native-config to react-native-web-config */
+       'react-native-config': 'react-native-web-config'
      ]
    ]
  }

License

MIT

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago