Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !1814

Updating the scripts to only execute when they are called directly.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/GreenGremlin/feature/importable-scripts into master Mar 13, 2017
  • Overview 5
  • Commits 2
  • Pipelines 0
  • Changes 4

Created by: GreenGremlin

In their current state, the scripts are cannot be imported without being immediately run. This change allows scripts to be imported and run directly. This change not only useful for creating custom script packages that wrap react-scripts, but is also a start toward making the scripts themselves testable.

const buildReact = require('react-scripts/scripts/build');

buildReact();

It would be nice to add the ability to pass options or custom config to the scripts, but I wanted to open this PR first and see where the discussion leads.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/GreenGremlin/feature/importable-scripts