在生产模式中,我必须从dist文件夹中提供文件。我的node_module文件夹位于dist文件夹之外。
当我将<script src="node_modules/jquery/jquery.min.js" />放在index.html中时,它将找不到该文件,因为我从dist文件夹中提供文件。当我在jQuery中导入vendor.ts时,它不起作用。
如何在中使用脚本标记使其在不使用的情况下工作
发布于 2016-06-08 06:52:45
如果您导入jquery文件:
import * as $ from "jquery";
// use $然后webpack会把它捆绑起来,因为你不需要在脚本标签中加入。
发布于 2016-06-08 06:56:27
每个JavaScript都需要脚本标记
假设您有以下目录结构
节点模块/
区/区
....index.html
并且您希望从index.html中的node_modules/加载jquery。那么您的脚本标记应该是
<script src="../node_modules/jquery/dist/jquery.js"></script>https://stackoverflow.com/questions/37695114
复制相似问题