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
  • !245

WIP: Add a 'run' script

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/lacker/run into master Jul 27, 2016
  • Overview 8
  • Commits 4
  • Pipelines 0
  • Changes 5

Created by: lacker

This adds a run script so that you can invoke a script in the same ES6-and-React-compatible environment you get when you run npm start, but in node.

To run a script:

  • Put your script in src, like at src/foobar.js
  • react-scripts run foobar.js

I wanted to get feedback if this seems like it's headed in the right direction. In particular are these decisions the right behavior:

  • This doesn't compile node_modules.
  • This doesn't set NODE_ENV.
  • This stores the compiled files in a global temp directory.
  • This doesn't automatically polyfill fetch.

Things that I'm pretty sure are not the ideal behavior but can be improved later:

  • This doesn't cache anything
  • No sourcemaps
  • No arguments are passed to the script

It seems like a lot of the behavior will be similar between "run a one-off script" and "run unit tests" so perhaps we should have some underlying library that is shared between this and testing like https://github.com/facebookincubator/create-react-app/pull/216 .

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/lacker/run