繁体   English   中英

生产版本-不要打开应用

[英]production build - dont open app

对于这个简短的问题,我感到抱歉。 我不知道如何部署angular2应用程序,所以不知道该写些什么来帮助我。 我需要部署生产。 当我运行此命令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)

我不知道哪里可能出问题,也不知道必须向您显示哪些文件。 请告诉我您要查看哪些文件。

我将构建的文件复制到服务器中的文件夹。 我添加了web.config并将应用程序添加到IIS DefaultAppPool。 我得到这个错误:

        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)

这是我的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