?
Solved

convert Systemjs to Webpack

Posted on 2017-03-15
3
Medium Priority
?
396 Views
Last Modified: 2017-03-20
Started angular2 app in a mvc application.
want to upgrade to the latest using webpack Angular Cli.

The application works as is using the app folder in the root and my mvc is called in my views folder and my main layout.cshtml is used here to call my
main page.
 <script>
        System.import('app').catch(function(err){ console.error(err); });
    </script>

my index.cshtml located in my view Home folder.    <callindex-app></callindex-app>

If I use webpack System.import is not supported and that eliminates my index.cshtml from using any of the angular2 functions.

Is there a way I can still call an angular2 application and embed it in a index.cshtml page like I am doing with systemjs angular2
0
Comment
Question by:Seven price
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 42053074
I found this article on the webpack forums
https://github.com/webpack/webpack/issues/2163

Which looks like it might deal with the issue you are referring to

This comment from the team seems to indicate that they went with import() over System.import
We talked about this at our last meeting.

Since we need a way to define split points in ES2015 modules but we also can't wait for the TC to confirm the spec before releasing webpack 2, we decided to use import() instead of System.import() to mark split points. I think, this makes sense since we know that the current syntax (System.import()) will be wrong anyway. So let's stick with the most likely (although we can't guarantee it).

Give that a try and see if it works for you.
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 42055726
Thanks bro. It was very helpful
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 42056048
You are welcome.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
Simple Linear Regression
Starting up a Project
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question