Skip to content

removing the create-react-app Source directories config jail #3

Description

@vladp

Thank you for putting together the work around.
I am having, still some difficulties, getting my project out of this CRA source directories jail.
Wondering if you could take a look and see if there is something easy to fix.

My initial problem is due to not being able to use symlinks under src to share code with my react-native project
react/create-react-app#4295

Here is the override file I am trying to use

config.overrides.dev.js


const path = require('path');


const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const paths = require('./paths');



module.exports = function(config) {
  config.resolve.symlinks= true;
  
  // my console.log do not get printed  
  
// tried to modify the parameters to the module scope plugin -- does not work
  let myPath='C:\\Users\\v\\home\\devel\\mine\\commonlibrary_src';
  let myModuleScopePlugin= new ModuleScopePlugin(paths.appSrc,
                                                 [paths.appPackageJson,
                                                 myPath]);
  
  config.resolve.Xplugins.unshift(myModuleScopePlugin);
 //tried to remove the plugin all together -- does not work, either
  //config.resolve.plugins.splice[0,0];
}

package.json


{
    "name": "ua1b",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
        "create-react-class": "15.6.3",
        "proxyquire": "^2.0.1",
        "react": "^16.3.1",
        "react-dom": "^16.3.1",
        "react-native-deprecated-custom-components": "github:facebookarchive/react-native-custom-components",
        "react-native-material-kit": "github:xinthink/react-native-material-kit#master",
        "react-native-section-list-get-item-layout": "2.2.1",
        "react-native-vector-icons": "^4.5.0",
        "react-native-web": "^0.5.4",
        "react-scripts": "1.1.4",
        "rewire": "^4.0.0",
        "tree-model": "^1.0.6"
    },
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test --env=jsdom",
        "eject": "react-scripts eject",
        "ostart": "node scripts/customized-config start",
        "obuild": "node scripts/customized-config build",
        "otest": "node scripts/customized-config test --env=jsdom"
    },
    "devDependencies": {
        "babel-plugin-react-native-web": "^0.5.4"
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions