alitaheri / jss-rtl

Flip styles using rtl-css-js
MIT License
83 stars 5 forks source link

Source map issue #2

Closed daanaerts closed 7 years ago

daanaerts commented 7 years ago

Hi,

on line 31 of ./lib/main.js there seems to be a problem with a sourceMap url

...
            }
            var flip = opt === 'out'; // If it's set to opt-out, then it should flip by default
            if (typeof sheet.options.flip === 'boolean') {
                flip = sheet.options.flip;
            }
            if (typeof style.flip === 'boolean') {
                flip = style.flip;
                delete style.flip;
            }
            if (!flip) {
                return style;
            }
            return convert(style);
        },
    };
}
exports.default = jssRTL;
//# sourceMappingURL=main.js.map <----- 

when running this through source-map-loader I get the following error:


(Emitted value instead of an instance of Error) Cannot find source file '../src/main.ts': Error: Can't resolve '../src/main.ts' in '/Users/anonymous/workspace/sylc/webapp/node_modules/jss-rtl/lib'
NonErrorEmittedError: (Emitted value instead of an instance of Error) Cannot find source file '../src/main.ts': Error: Can't resolve '../src/main.ts' in '/Users/anonymous/workspace/sylc/webapp/node_modules/jss-rtl/lib'```
daanaerts commented 7 years ago

Second looks it's something with the TS setup. Sourcemap points to src map, but then when I run it in my project with source-map-loader it looks in src instead of lib

alitaheri commented 7 years ago

Ops, looks like I forgot to add the src folder to the package.json file 😅 😅

Thanks @daanaerts 👍 👍

alitaheri commented 7 years ago

Fixed in v0.2.1 👍