Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !4998
An error occurred while fetching the assigned milestone of the selected merge_request.

Enable setting various types of sourcemaps.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/cliff76/patch-1 into next 6 years ago
  • Overview 5
  • Commits 3
  • Pipelines 0
  • Changes 1

Created by: cliff76

On certain platforms (for eg. Tizen TVs) we need the ability to enable a specific type of sourcemap (eval-source-map). True/false is too limiting.

I verified this minor change by running yarn build with different values for the GENERATE_SOURCEMAP environment variable then inspecting the resulting main..js under build/static/js/ Setting the env var to false preserves existing behavior. Setting it to other allowed sourcemap values correctly changes the resulting output JS bundle.

Compare
  • next (base)

and
  • latest version
    652681ed
    3 commits, 2 years ago

1 file
+ 3
- 1

    Preferences

    File browser
    Compare changes
packages/react-scripts/config/webpack.config.prod.js
+ 3
- 1
  • View file @ 652681ed


@@ -29,6 +29,8 @@ const getClientEnvironment = require('./env');
const publicPath = paths.servedPath;
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
//if there was a SOURCEMAP_TYPE env variable specified, use it, otherwise default to 'source-map'
const sourceMapType = process.env.SOURCEMAP_TYPE && process.env.SOURCEMAP_TYPE.trim() !== '' ? process.env.SOURCEMAP_TYPE : 'source-map';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
@@ -95,7 +97,7 @@ module.exports = {
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
devtool: shouldUseSourceMap ? 'source-map' : false,
devtool: shouldUseSourceMap ? sourceMapType : false,
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/cliff76/patch-1

Menu

Explore Projects Groups Snippets