Solved

convert Systemjs to Webpack

Posted on 2017-03-15
3
75 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 56

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 56

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
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 …

756 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