Skip to content

Adding support of multiple appSrc(s) in ModuleScopePlugin #4079

Closed

Description

@froyog

I'm currently working on a project which invovled two src folder (/src and /docs/src). And when I try to import files from /docs/src ModuleScopePlugin prevents me from doing it since /docs/src falls outside of /src.
So I'm wondering if ModuleScopePlugin can also accepts an array as its first parameter so that I can solve this problem with new ModuleScopePlugin([paths.appSrc, paths.docsSrc], [paths.appPackageJson]) (docsSrc is already defined in paths.js)

Activity

  1. Andarist commented on Feb 26, 2018

    @Andarist
    Contributor

    Actually u can do something like this:

    new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson, paths.docsSrc])
  2. froyog commented on Feb 27, 2018

    @froyog
    ContributorAuthor

    @Andarist Yeah it is a workaround but I don't think it's the best practice to pass a folder path to allowedFiles parameters
    https://github.com/facebook/create-react-app/blob/e9abde739240b3124ab7237cbf32a370c209511e/packages/react-dev-utils/ModuleScopePlugin.js#L14

  3. Andarist commented on Feb 27, 2018

    @Andarist
    Contributor

    does it differ anyhow in results?

  4. Timer commented on Mar 5, 2018

    @Timer
    Contributor

    I'd accept a pull request to add support for this in ejected setups (by letting appSrc accept an array), but not a non-ejected one. If you want to use a folder other than src/, look out for monorepo support in react-scripts@2.x.
    I'll close as unactionable by us.

  5. locked and limited conversation to collaborators on Jan 20, 2019
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions