frankwallis / plugin-typescript

TypeScript loader for SystemJS
MIT License
248 stars 47 forks source link

example project not working #31

Closed ghost closed 9 years ago

ghost commented 9 years ago

I had to install gulp, systemjs-builder. Then it says Broken @import declaration of src/index.css

jspm install fails saying the mgeazy typescript 1.5.2 is not a valid version.

TypeError: Invalid Version: v1.5-beta2

So I updated the systemjs-css plugin to latest and it's working.

However I copied the config.js to my own project and set it up and I'm getting errors.

c:\git\pos>gulp bundle
[13:19:53] Using gulpfile c:\git\pos\gulpfile.js
[13:19:53] Starting 'bundle'...
[Error: ENOENT, open 'c:\git\pos\jspm_packages\github\angular\bower-material@mas
ter\angular-material.css.js']
[13:19:54] 'bundle' errored after 951 ms
[13:19:54] Error: ENOENT, open 'c:\git\pos\jspm_packages\github\angular\bower-ma
terial@master\angular-material.css.js'
    at Error (native)
        Error loading file:///c:/git/pos/jspm_packages/github/angular/bower-mate
rial@master/angular-material.css.js from file:///c:/git/pos/src/app.ts
        Error loading file:///c:/git/pos/jspm_packages/github/angular/bower-mate
rial@master/angular-material.css.js
frankwallis commented 9 years ago

I don't think you want to copy the "map" section of config.js file to your project, you should copy the configuration at the top of example/config.js and any dependencies you need from the jspm section of example/package.json. Then run jspm install in your project and it will generate all the "map" configuration in your config.js. Whenever you want to update versions you need to delete this map configuration and run jspm install again.

ghost commented 9 years ago

@frankwallis that's what I did. Basically I just made sure all of the important parts match and they do.

Can't seem to find out why it's not working in my project and looking for ts.js and css.js. using jspm@beta too.

ghost commented 9 years ago

@frankwallis Think i discovered the issue.

// import 'api/websql/websql.service'; // tries to load api/websql/websql.service.ts.js
// import 'api/reflex/reflex.service'; // tries to load api/reflex/reflex.service.ts.js
import 'angular-material/angular-material.css'; // tries to load angular-material/angular-material.css.js
import './app.css'; // ok

seems anything with a / does not load correctly.

note: jspm install angular-material.

ghost commented 9 years ago

@frankwallis are you able to replicate the 'subdirectory' issue?

I planned on refactoring my project to remove the need for html and typescript gulp tasks. Just having JSPM/SystemJS take care of compilation for development and production.

Would this work with Unit tests written in ES6, using Karma-JSPM, without compiling the typescript?

frankwallis commented 9 years ago

I can replicate the angular-material issue, but I don't think it is related to this plugin. You can workaround it by doing import 'angular-material/angular-material.css!';

The api one is not so clear - is 'api' a separate jspm package and does it have a 'packages' entry in config.js? If so I don't know why the .js is being added, but again I don't think it is related to this plugin, it looks more like a systemjs issue.

I haven't used Karma-JSPM but I don't see why not. Otherwise you could bundle the tests doing something like buildSFX('./tests/test1 + ./tests/test2') I think.

ghost commented 9 years ago

api/ is a subfolder of mine. Not a seperate package, so no entry. Could be a systemjs issue.