angularjs - Heroku - No bower_components folder -
i'm deploying angular app heroku, , need bower add angular component , few others. deployment working, except deployed site missing bower_components folder. i've been through everything, , read many stackoverflow posts, must missing something. here code:
package.json
{ "name": "my-webapp", "version": "1.0.0", "main": "app.js", "dependencies": { "bower": "^1.8.0", "express": "^4.15.2" }, "devdependencies": {}, "scripts": { "start": "node web.js", "postinstall": "./node_modules/bower/bin/bower install" }, "repository": { "type": "git", "url": "git+https://github.com...." }, "author": "", "license": "isc", "bugs": { "url": "https://github.com..." }, "homepage": "https://github.com...", "description": "" }
web.js
var express = require('express'), app = express(); app.use(express.static(__dirname)); app.get('/', function(req, res) { res.sendfile('index.html', {root: __dirname }) }); var server = app.listen(process.env.port || 80);
procfile
web: node web.js
bower.json
{ "name": "my-webapp", "description": "", "main": "app.js", "authors": [ "me" ], "license": "isc", "homepage": "https://my-webapp.herokuapp.com/", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular-material-icons": "^0.7.1", "angular-material": "^1.1.1", "materialize": "^0.97.8", "ng-lodash": "^0.5.0" }
here build output, edited highlights :
-----> building dependencies prebuild detected (node_modules exists) rebuilding native modules bower@1.8.0 /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/bower express@4.15.2 /tmp/build_9a163093ad395af381c984026f6a5742/mugwag-my-webapp-bfae0f9/node_modules/express -----> caching build clearing previous node cache saving 2 cachedirectories (default): - node_modules - bower_components -----> build succeeded! -----> rebuilding native dependencies bower@1.8.0 /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/bower express@4.15.2 /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/express ????????? bower@1.8.0 npm warn my-webapp@1.0.0 no description -----> found bower.json, running bower install -----> installing dependencies > my-webapp@1.0.0 postinstall /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9 > ./node_modules/bower/bin/bower install npm warn my-webapp@1.0.0 no description
to me, looks though working, when load page, load of broken links bower_components folder :
cannot /bower_components/materialize/dist/css/materialize.css
there no bower folder. why!?
fyi - never solved problem, use amazon s3 host angular apps. because angular entirely client-side, no server needed. upload code s3 or similar, plain hosting , reference directly.
i hope helps someone.
Comments
Post a Comment