Solved

convert Systemjs to Webpack

Posted on 2017-03-15
3
120 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 57

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
ID: 42055726
Thanks bro. It was very helpful
0
 
LVL 57

Expert Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

736 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