add <script>, <link> ref replace && fix file path resolve