requirejs - Deploy with r.js and bower -
requirejs - Deploy with r.js and bower -
i'm pretty new using npm, bower etc. , deploying it. haven't had decent workflow or way of setting projects on enivornment, thought improve late never.
i can't, however, wrap head around how deploy this, i.e. concatenating , minifying. below project structure:
root │ └───app │ index.html │ ├───bower_components | <all components> │ ├───js | ├── modules │ | main.js | | | └── plugins | <amd enabled plugins> | scripts | build.sh | the project runs fine in development. have used grunt-bower-requirejs wire bower dependencies main.js.
now i'm @ stage i'd deploy , see how works. goal minify , concatenate bower dependenices , modules using r.js. i've created build file r.js looks this:
({ appdir: "../app", baseurl: "js/mdoules", dir: "../build", modules: [ { name: "main" } ], paths: { aplugin: "../plugins/aplugin", abowerdep: "../../bower_components/abowerdep" }, shim: { <some non amd stuff> } }) this called script build.sh.
the script copies files app directory build directory. have uploaded resulting build file here if help. there couple of problems here don't know how solve:
all files bower_components end in build folder, not necessary files i've pointed out in r.js build file. how necessary files only? files minified, not concatenated, still located in original directories. i resulting file in build/js/modules called main.js, have no thought ended here. it's total of 9200 rows unminified, , jquery more that. contains lot of comments bower dependencies have, of them not in file.i have couple of questions when , if , running:
when loading main script require, can point out concatenated , minified file contains requirejs? same question regarding main module, cant point out data-main?to clarify, can this:
class="lang-html prettyprint-override"><script type="text/javascript" data-main="all_modules" src="all_bower_dependencies.js"></script> instead of this:
class="lang-html prettyprint-override"><script type="text/javascript" data-main="js/modules/main" src="bower_components/requirejs/require.js"></script> am using bower incorrectly? bad form minify these dependencies? appreciate help get. please tell me if i'm doing way crazy here.
requirejs bower minify concat r.js
Comments
Post a Comment