grunt-usemin

Angular grunt build (from yeoman) breaks my app

本小妞迷上赌 提交于 2019-12-04 01:09:42
问题 after running the build from the /dist folder I get: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.1/$injector/modulerr?p0=ourname&p1=Error%3A…(http%3A%2F%2Flocalhost%3A8085%2Flib%2Fangular%2Fangular.min.js%3A32%3A462) nothing I do seems to solve this problem this is the grunt task flow - adapted 1 to 1 from yeoman angular-generator: module.exports = function(grunt){ require('load-grunt-tasks')(grunt); require('time-grunt')(grunt); grunt.initConfig({ //pkg: grunt.file

How to define individual flows in useminPrepare for each block in html file?

末鹿安然 提交于 2019-12-03 17:31:30
问题 We have 2 blocks defined in our index.html - one for 3rd party libs and one for our application files. Since 3rd party libs are already minified, we just want to concatenate them, but not uglify. How can I do this with useminPrepare ? <!-- build:js js/lib.js --> <script src="lib/angular/angular.min.js"></script> <script src="lib/angular-cookies/angular-cookies.min.js"></script> <script src="lib/angular-route/angular-route.min.js"></script> <!-- endbuild --> <!-- build:js js/app.js --> <script

GruntJS - wrong image paths after grunt build

人走茶凉 提交于 2019-12-03 08:58:44
Grunt is messing my minified CSS and I cannot figure out why and how to avoid it. To be brief, before the minification I have some background images like this: .head-image { height: 380px; background: url("../images/head1_bg.png") repeat-x; -webkit-background-size: cover; background-size: cover; } Then, after the whole process, I have a minified CSS that goes like this (snippet): [...]background:url(/home/domo/projects/lp/.tmp/images/head1_bg.png) repeat-x;background-size:cover}[...] The aforementioned path not only is an absolute path, but it's even wrong, since the images can be found in

How to define individual flows in useminPrepare for each block in html file?

血红的双手。 提交于 2019-12-03 06:22:05
We have 2 blocks defined in our index.html - one for 3rd party libs and one for our application files. Since 3rd party libs are already minified, we just want to concatenate them, but not uglify. How can I do this with useminPrepare ? <!-- build:js js/lib.js --> <script src="lib/angular/angular.min.js"></script> <script src="lib/angular-cookies/angular-cookies.min.js"></script> <script src="lib/angular-route/angular-route.min.js"></script> <!-- endbuild --> <!-- build:js js/app.js --> <script src="js/app.js"></script> <script src="js/controllers/LanguageCtrl.js"></script> <!-- endbuild -->

Node glob pattern for every .js file except .spec.js

本秂侑毒 提交于 2019-12-03 03:25:56
问题 I am looking for a better glob pattern for usemin, i want to to find all .js files but exclude the .spec.js files. I have the following solution so far. <script src="components/**/*(.js|!(*.spec.js|*.scss))"></script> The solution i have at the moment requires me to keep adding file extensions to exclude them, else they get picked up, for example .html files. I tried to make it only look for .js files and exclude the .spec.js from them but it does not seem to work. Also adding a !components/*

How do I remove some javascript during grunt-usemin compilation

不打扰是莪最后的温柔 提交于 2019-12-02 23:17:59
I have code that makes it easy and fast to write/test code, that code does not belong in my production code (mostly it mocks out the server so I only need the grunt server). Two parts to this, one is how to I remove parts of a script angular.module('nglaborcallApp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'server_mocks', // Don't want this line in the production build 'dialogs' ] and then a section of index.html that needs to go away <!-- build:js({.tmp,app}) scripts/mocks/mocks.js --> <script type='text/javascript'>var Mocks = {};</script> <script src='scripts/mocks/jobs.js'><

How should I configure grunt-usemin to work with relative path

杀马特。学长 韩版系。学妹 提交于 2019-12-02 16:20:06
I have a grunt project backed by a yeoman-generator that I've built based on the generator-webapp , if it's of any help, you can find it on GitHub The grunt project makes us of the grunt-usemin task. My project involve building a multilingual website, and to keep things clean, I've decided to put all the pages written in a language in a folder name after the 2-letter shortcode of the said language. | project/ |--dist/ |----en/ |------index.html |------404.html |------... |----fr/ |------index.html |------404.html |------... The files are made from handlebars templates and processed with

can grunt automatically include all my js in index.html? [closed]

房东的猫 提交于 2019-12-01 14:59:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I'm new to grunt. I'm coming from rails and getting into angular. From what I can see grunt usemin can replace <script src=...> between build directives and replace that with a single minified js during grunt build. That's great for deployment. However whenever I add new angular

Angular grunt build (from yeoman) breaks my app

喜欢而已 提交于 2019-12-01 04:15:28
after running the build from the /dist folder I get: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.1/$injector/modulerr?p0=ourname&p1=Error%3A…(http%3A%2F%2Flocalhost%3A8085%2Flib%2Fangular%2Fangular.min.js%3A32%3A462) nothing I do seems to solve this problem this is the grunt task flow - adapted 1 to 1 from yeoman angular-generator: module.exports = function(grunt){ require('load-grunt-tasks')(grunt); require('time-grunt')(grunt); grunt.initConfig({ //pkg: grunt.file.readJSON('package.json'), yeoman: { // configurable paths app: require('./bower.json').appPath || 'app',

Source maps with grunt

杀马特。学长 韩版系。学妹 提交于 2019-11-29 02:21:48
Do you know of a workflow that includes source maps for an app compiled with grunt? I am well aware of plugins like uglifyjs that allow you to simply generate a source map. But I'm looking for incorporating this into a more complex workflow, rather than just making a one-off source map. I've noticed that the most popular Yeoman generators (that I know of) are missing source maps in their workflows. Is this just because of a lack of support in the major plugins for source maps? Or is it instead that source maps aren't necessary in work flows, and I just can't think of a clever enough