Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Vue App with TypeScript + SystemJS #29

Open
kvigor opened this issue Nov 16, 2017 · 3 comments
Open

Vue App with TypeScript + SystemJS #29

kvigor opened this issue Nov 16, 2017 · 3 comments

Comments

@kvigor
Copy link

kvigor commented Nov 16, 2017

I wanted to know what changes need to be made to my tsconfig and systemjs config if I'm using TypeScript + SystemJS and NOT "webpack + es2015 module loader"? As of now Vue is resolving for me with the below changes
import Vue from "../jspm_packages/npm/[email protected]/types/vue";
but it does resolve if I do
import { Vue } from "../jspm_packages/npm/[email protected]/types/vue"; I do not understand the nuance of when and when not to use the curly braces and why.

@kvigor kvigor changed the title Vue App with TypeScript + SystemJS + JSPM Vue App with TypeScript + SystemJS Nov 16, 2017
@alpham8
Copy link

alpham8 commented Jul 10, 2018

@kvigor Do you have a working Vue + SystemJS + TypeScript setup? I would love to see it.
The curly braces in import statements are only for if you want to pick the parts that you want to import. If you want just all, it's also fine without curly braces.

@kvigor
Copy link
Author

kvigor commented Jul 11, 2018

No. I was forced to use aspnetcore-Vue-starter which uses webpack. SystemJS had a package that worked with typescript but was abandoned hence our delima.

@alpham8
Copy link

alpham8 commented Jul 12, 2018

After a lot more research, I found an helpful article. I am really thankful to this guy: https://westerndevs.com/javascript/How-to-Compile-TypeScript-into-a-Single-File-with-SystemJS-Modules-with-Gulp/
And his exmaple project repo here: https://github.com/davidwesst/ts-systemjs

I was able to change this to grunt with ease. That now totally integrates in my grunt work flow, really nice!

Only question left: Why I can import Vue in a class like this guy did, but not at top level without any wrapping class? There are no errors, but Vue doesn't get parsed, although it is in bundle.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants