Closed wprater closed 9 years ago
:+1:
same here
I think this problem was caused by SystemJS code change here, @wprater 's commit https://github.com/geelen/jspm-loader-css/pull/18 could solve half the problem, the path would still be a undefined
. But we might extract it from load.address
?
Just created some demo codes here based on wprater's commit, works fine on my project as far as i can see.
@chenxsan thanks, perhaps this is better. was this for an error with the builder?
@wprater Oops, it would cause an error when building with jspm, guess there are better ways to do it.
@chenxsan did you check my updated PR?
@wprater Just checked it, it would export css class like "_http_127_0_0_1_9999_style_app__standout" if I had
:local(.standout) {}
in my app.css file. That _http_127_0_0_1_9999
part is needless.
Ive never tried the modules feature. is this another issue, or something related to the path still? Im not sure I understand.
If I had
:local(.standout){}
in style/app.css
, jspm-loader-css would produce a css class ._style_app__standout
, so your updated PR is ok, but that host part like _http_127_0_0_1_9999
is redundant(I'm running the project in http://127.0.0.1:9999 with jspm-server), maybe @geelen can explain it better :).
Hi, any updates on this issue?
@wprater Your patch-1 worked with :local(.lol)
becoming _http_localhost_8080_src_main__lol
but fails if I include composes:
with the error Uncaught (in promise) Error: Cannot read property 'push' of undefined(…)
. Not sure if that is a separate issue.
Hi @wprater, I tried your fix, it works well using System.import. But when building using 'bundle-sfx', the css is not present in the code though classes are set correctly for html tag. I'm not sure why but do you have a fix for it? Thanks!
Based on @wprater 's pull request, I made it work in bundle mode too. Here is my pull request. It works for me when using 'bundle-sfx' to bundle the code.
This still seems to be broken even with the PR? Is there something special that needs to happen?
@MeoMix which PR are you using? What's the error you got?
@f15gdsy It seems to have fixed itself this morning after updating to the latest version of JSPM. Not sure if that's related at all, but I am successfully loading CSS now. :+1:
EDIT:
Oh, it was because I was overriding css.js and didn't update that with the PR changes. I'm now doing:
import { CSSLoader, Plugins, fetch, bundle } from 'jspm-loader-css';
console.log('Plugins:', Plugins);
const loader = new CSSLoader([
Plugins.autoprefixer()
], __moduleName);
export default loader;
export { CSSLoader, Plugins, fetch, bundle };
Working on a new release to fix all these breakages. Will be a new major version, building on @douglasduteil's work. First PR merged in here: https://github.com/geelen/jspm-loader-css/pull/23
I seem to be having issues with the plugin on SystemJS 0.18.x. seems like it's trying to process it as JS and never gets to the
fetch
call.