Skip to content

global transform breaks everything #35

Closed

Description

@wenbing

I'm using browserify build my bundle-xxx.js.

but when use css-modulesify plugin, it add a global transform, causes something like brfs broken.

because when global transform is after the local transform. brfs as a local transform is priority to the css-modulesify global transform.

while brfs parses the .css file, it throws a SyntaxError.

function getTransforms (pkg, opts) {
    var trx = [];
    if (opts.transformKey) {
        var n = pkg;
        var keys = opts.transformKey;
        for (var i = 0; i < keys.length; i++) {
            if (n && typeof n === 'object') n = n[keys[i]];
            else break;
        }
        if (i === keys.length) {
            trx = [].concat(n).filter(Boolean);
        }
    }
    return trx.concat(opts.globalTransform || []);
}

Activity

  1. joshwnj commented on Aug 24, 2015

    @joshwnj
    Member

    Thanks for the report @wenbing. There's a related discussion going on in #31

    Hopefully the brfs PR will be accepted so that you can upgrade to that.

    I also plan to see if there's a way to get the desired result without using the global flag, which would also solve your issue and possibly others. If you have any ideas please let me know :)

  2. wenbing commented on Aug 25, 2015

    @wenbing
    ContributorAuthor

    discuss it in #31

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