Solved

convert Systemjs to Webpack

Posted on 2017-03-15
  • .NET MVC
  • webpack
  • Angular2
  • AngularJS
  • Programming
  • +3
3
32 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:sevensnake77
  • 2
3 Comments
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 500 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:sevensnake77
Thanks bro. It was very helpful
0
 
LVL 55

Expert Comment

by:Julian Hansen
You are welcome.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

860 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