Skip to content

sourceMaps are always generated #21

@ZaDarkSide

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';
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions