我認爲它已準備好投入生產並在途中遇到錯誤,我將Angular2-Electron應用打包了起來。出現的錯誤是我的引導帶和JQuery無法找到。現在我通過node_modules將其加載到index.html中。這工作很好,直到我不得不打包。在本地加載JQuery和bootstrap以便我的電子應用程序可以找到它的最佳方式是什麼? 我得到的錯誤是錯誤找不到模塊 我理解爲什麼,這是因爲當電子打包東西時,一切都移動到一個文件,我只是不知道何時何地加載引導程序和JQuery到對應的位置如何在電子應用中實現JQuery和Bootstrap
的index.html:
<script>window.$ = window.jQuery = require('../node_modules/jquery/dist/jquery.min.js');</script>
<script src="../node_modules//bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap-theme.min.css">
嗯,它在這之前工作100%,但我也這樣做,仍然得到: –
我明白了原因,這是因爲當電子包東西時,一切都被移動到一個文件,我只是不知道何時何地將bootstrap和jquery加載到相應的位置 –