简体   繁体   English

生产版本-不要打开应用

[英]production build - dont open app

I am sorry for this short question. 对于这个简短的问题,我感到抱歉。 I don't know how to deploy angular2 app so I don't know what to write to help me. 我不知道如何部署angular2应用程序,所以不知道该写些什么来帮助我。 I need to deploy production. 我需要部署生产。 When I run this command npm build -prod , its ok, copy all js and html to dist folder, but when I open index.html in browser app don't start and in the log is this: 当我运行此命令npm build -prod ,可以将所有js和html复制到dist文件夹,但是当我在浏览器应用中打开index.html时不启动,并且在日志中是:

/E:/styles.a530fc809103522200ce.bundle.css Failed to load resource: net::ERR_FILE_NOT_FOUND
inline.64b91d2d61fb76e9d35a.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
polyfills.fe38fa94cd758b43a148.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
scripts.42e3c7ff6b40c17280bd.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
vendor.7b7007a424e50f334b56.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
main.5f1b617b49bf3e0d0eaa.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
jquery-3.2.1.slim.min.js:2 jQuery.Deferred exception: $(...).select2 is not a function TypeError: $(...).select2 is not a function
    at HTMLDocument.<anonymous> (file:///E:/User/antos/Dokumenty/Projects/PCL%20VA/ProLight/ProLight.Client/dist/index.html:26:21)
    at j (https://code.jquery.com/jquery-3.2.1.slim.min.js:2:30203)
    at k (https://code.jquery.com/jquery-3.2.1.slim.min.js:2:30517) undefined
r.Deferred.exceptionHook @ jquery-3.2.1.slim.min.js:2
/E:/favicon.ico Failed to load resource: net::ERR_FILE_NOT_FOUND
jquery-3.2.1.slim.min.js:2 Uncaught TypeError: $(...).select2 is not a function
    at HTMLDocument.<anonymous> (index.html:26)
    at j (jquery-3.2.1.slim.min.js:2)
    at k (jquery-3.2.1.slim.min.js:2)

I don't know where can be a problem and I don't know which files I must show you. 我不知道哪里可能出问题,也不知道必须向您显示哪些文件。 Please tell me which files you want to see. 请告诉我您要查看哪些文件。

I copied builded files to folder in server. 我将构建的文件复制到服务器中的文件夹。 I added web.config and added app to IIS DefaultAppPool. 我添加了web.config并将应用程序添加到IIS DefaultAppPool。 And I get this errors: 我得到这个错误:

        GET http://server/inline.64b91d2d61fb76e9d35a.bundle.js 
    server/:36 GET 
http://server/polyfills.fe38fa94cd758b43a148.bundle.js 
    server/:17 GET 
http://server/styles.a530fc809103522200ce.bundle.css 
    server/:36 GET 
http://server/scripts.42e3c7ff6b40c17280bd.bundle.js 
    server/:36 GET 
http://server/vendor.7b7007a424e50f334b56.bundle.js 
    server/:36 GET 
http://server/main.5f1b617b49bf3e0d0eaa.bundle.js 
    (index):36 GET 
http://server/inline.64b91d2d61fb76e9d35a.bundle.js 
    (index):36 GET 
http://server/polyfills.fe38fa94cd758b43a148.bundle.js 
    (index):36 GET 
http://server/scripts.42e3c7ff6b40c17280bd.bundle.js 
    (index):36 GET 
http://server/vendor.7b7007a424e50f334b56.bundle.js 
    (index):36 GET 
http://server/main.5f1b617b49bf3e0d0eaa.bundle.js 
    jquery-3.2.1.slim.min.js:2 jQuery.Deferred exception: $(...).select2 is not a function TypeError: $(...).select2 is not a function
        at HTMLDocument.<anonymous> (http://sigma913/ProLight.Client/:26:21)
        at j (https://code.jquery.com/jquery-3.2.1.slim.min.js:2:30203)
        at k (https://code.jquery.com/jquery-3.2.1.slim.min.js:2:30517) undefined
    r.Deferred.exceptionHook @ jquery-3.2.1.slim.min.js:2
    k @ jquery-3.2.1.slim.min.js:2
    jquery-3.2.1.slim.min.js:2 Uncaught TypeError: $(...).select2 is not a function
        at HTMLDocument.<anonymous> ((index):26)
        at j (jquery-3.2.1.slim.min.js:2)
        at k (jquery-3.2.1.slim.min.js:2)

Here is my web.config: 这是我的web.config:

<configuration>
    <system.webServer>
        <handlers>
           <clear />
            <add 
                name="StaticFile" 
                path="*" verb="*" 
                modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" 
                resourceType="Either" 
                requireAccess="Read" />
        </handlers>
        <staticContent>
            <mimeMap fileExtension=".*" mimeType="application/octet-stream" />
        </staticContent>
    </system.webServer>
</configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM