我不确定我是以正确的方式做到这一点。我已经定义了以下模块:
require('angular');
require('angular-ui-router');
var $ = require('jquery');
require('bootstrap');
我的package.json文件是这样的:
{
"name": "web",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"build": "browserify main.js -o bundle.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"browserify": "^12.0.1"
},
"dependencies": {
"angular": "^1.4.8",
"angular-ui-router": "^0.2.15",
"bootstrap": "^3.3.6",
"bootstrap-social": "^4.11.0",
"font-awesome": "^4.5.0",
"jquery": "^2.1.4"
}
}
我的html页面:
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div id="wrap">
<!--header-->
<div ui-view="header"></div>
<!--main content-->
<div ui-view="content"></div>
</div>
<!--push the footer down-->
<div id="push"></div>
<!--footer-->
<div ui-view="footer"></div>
<script src="bundle.js"></script>
<script src="commonViews/commonView.js"></script> //angular module defined
</body>
</html>
当我运行html页面时,我在控制台中收到一条错误,说“角度未定义”
我做错了什么?我已经运行了命令browserify maing.js -o bundle.js
,它将所有代码缩小为bundle.js文件,但仍然是同样的错误。除此之外,我无法捆绑bootstrap和font-awesome css文件。 broswerify不支持css文件吗?