我已經(jīng)使用這個(gè)模板來(lái)開(kāi)發(fā)我的應(yīng)用程序,它是一個(gè)帶有 Electron 建構(gòu)器的 Vue 應(yīng)用程式?,F(xiàn)在我有一個(gè)問(wèn)題: 我需要建立生產(chǎn)並部署我的專(zhuān)案一次作為電子包,另一次部署為託管在 Web 伺服器上的 Web 應(yīng)用程式。我也不想將它分成兩個(gè)儲(chǔ)存庫(kù)。有人有建議嗎?
我嘗試使用 dist 資料夾作為網(wǎng)站的根資料夾,並添加了一個(gè) web.config 文件,如下所示,但出現(xiàn)錯(cuò)誤。
web.config檔內(nèi)容:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Vue" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_URI}" pattern="^/api/.*" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
IIS 上的錯(cuò)誤:
是的,您需要在 IIS 上安裝 url 重寫(xiě)模組。否則,IIS 將無(wú)法理解 <rewrite> <rules> <rule name="Vue" stopProcessing="true">
在 web.config 中的意義。
從此處下載
#