2017-02-24 56 views
1

我使用ASP.net MVC 5與ReactJS.net。它在Dev模式下工作正常,但是當我將它啓動到IIS時,我無法做出反應。什麼必須從DEV更改爲發佈,使其正確編譯?是否應該添加bundle.configweb.config如何啓動Reactjs.Net到IIS

這裏是我的bundle.config看起來像

public static void RegisterBundles(BundleCollection bundles) 
{ 
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
       "~/Scripts/jquery-{version}.js")); 

    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
       "~/Scripts/jquery.validate*")); 

    bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
    "~/Scripts/jquery-ui-{version}.js")); 

    // Use the development version of Modernizr to develop with and learn from. Then, when you're 
    // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 
    bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
       "~/Scripts/modernizr-*")); 

    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
       "~/Scripts/bootstrap.js", 
       "~/Scripts/jasny-bootstrap.js", 
       "~/Scripts/respond.js", 
       "~/Scripts/bootbox.js", 
       "~/Scripts/bootstrap-multiselect.js")); 

    bundles.Add(new ScriptBundle("~/bundles/inputanimations").Include(
       "~/Scripts/app/elements/textInputAnimations.js")); 

    bundles.Add(new StyleBundle("~/Content/css").Include(
       "~/Content/bootstrap.css", 
       "~/Content/jasny-bootstrap.css", 
       "~/Content/font-awesome.css", 
       "~/Content/site.css", 
       "~/Content/textbox.css", 
       "~/Content/Scheduler.css", 
       "~/Content/bootstrap-multiselect.css", 
       "~/Content/dhtmlxgantt.css", 
       "~/Content/dhtmlx.css")); 

    bundles.Add(new StyleBundle("~/Content/themes/base/jqueryuicss").Include(
       "~/Content/themes/base/all.css", 
       "~/Content/themes/base/base.css", 
       "~/Content/themes/base/theme.css")); 

    bundles.Add(new ScriptBundle("~/bundles/dxhtmlgantt").Include(
        "~/Scripts/dhtmlxgantt.js", 
        "~/Scripts/ext/dhtmlxgantt_smart_rendering.js", 
        "~/Scripts/app/ganttChartPropertyInitializer.js" 
       )); 

    bundles.Add(new ScriptBundle("~/bundles/reactdependencies").Include(
        "~/Scripts/react.js", 
        "~/Scripts/react-dom.js", 
        "~/Scripts/remarkable.js" 
       )); 

    bundles.Add(new BabelBundle("~/bundles/reactganttcomponents").Include(
       "~/Scripts/app/components/gantt/ganttFilter.jsx", 
       "~/Scripts/app/components/gantt/InfoPanel.jsx", 
       "~/Scripts/app/components/gantt/index.jsx" 
       )); 

    bundles.Add(new ScriptBundle("~/bundles/dxhtmlganttservices").Include(
     "~/Scripts/app/taskManager.js", 
     "~/Scripts/app/GanttChartService.js", 
     "~/Scripts/app/ganttChartStateManagerService.js", 
     "~/Scripts/app/GanttFilter.js", 
     "~/Scripts/app/infoPanelService.js", 
     "~/Scripts/app/ganttToolbarControlInitializaer.js" 
    )); 

    bundles.Add(new BabelBundle("~/bundles/reacttoolbarcomponents").Include(
    "~/Scripts/app/components/gantt/timelineScale.jsx", 
    "~/Scripts/app/components/gantt/newProject.jsx", 
    "~/Scripts/app/components/gantt/newSubProject.jsx", 
    "~/Scripts/app/components/gantt/newActivity.jsx", 
    "~/Scripts/app/components/gantt/updateActivity.jsx" 
    )); 


    bundles.Add(new ScriptBundle("~/bundles/dxhtmlsuite").Include(
     "~/Scripts/dhtmlx.js")); 

    BundleTable.EnableOptimizations = true; 
} 

回答

1

搜索後,我發現,當我發佈的應用程序沒有我的JavaScript文件正在包裝的時間。
我的腳本文件夾裏面是空的。我不得不刪除我所有的*.jsx文件,然後重新創建它們。