Skip to content

sourceMaps are always generated #21

Description

@ZaDarkSide

I think there is a bug in jsx.js:

    require.config({
        babel: {
            sourceMaps: false // this will be ignored
        }
    });
    function getSourceMapConfig(config) {
        // if isBuild is not present it will always be 'inline' regardless of config,
        // maybe we want to overwrite this but we can't without isBuild: true
        var fallback = config.isBuild ? false : 'inline'; 

        if (config && config.babel && 'sourceMaps' in config.babel) {
            return config.babel.sourceMaps;
        } else {
            return fallback;
        }
    }

In order to workaround this problem you could add isBuild: true like this:

    require.config({
        isBuild: true,
        babel: {
            sourceMaps: false // this will not be ignored, sourceMaps will be disabled
        }
    });

To fix this problem you need to change function getSourceMapConfig(config) like this:

    function getSourceMapConfig(config) {
        if (config && config.babel && 'sourceMaps' in config.babel) {
            return config.babel.sourceMaps;
        } else {
            return 'inline';
        }
    }

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions