Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Last active August 29, 2015 13:56
Show Gist options
  • Save jonathanmarvens/9174219 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/9174219 to your computer and use it in GitHub Desktop.
# grunt ---stack
# Running "clean:build" (clean) task
# Running "emberTemplates:app" (emberTemplates) task
# File "./app/.templates.js" created.
# Running "build-index" task
# generating from:
# - node_modules/loom-generators-ember/loom
# created: app/.index.js
# Running "browserify:dev" (browserify) task
# Warning: Arguments to path.resolve must be strings Use --force to continue.
# TypeError: Arguments to path.resolve must be strings
# at Object.exports.resolve (path.js:313:15)
# at /srv/app-dev/app/client/node_modules/grunt-browserify/tasks/browserify.js:126:33
# at Array.map (native)
# at /srv/app-dev/app/client/node_modules/grunt-browserify/tasks/browserify.js:125:12
# at iterate (/srv/app-dev/app/client/node_modules/grunt-browserify/node_modules/async/lib/async.js:134:13)
# at Object.async.eachSeries (/srv/app-dev/app/client/node_modules/grunt-browserify/node_modules/async/lib/async.js:150:9)
# at Object.<anonymous> (/srv/app-dev/app/client/node_modules/grunt-browserify/tasks/browserify.js:27:11)
# at Object.<anonymous> (/srv/app-dev/app/client/node_modules/grunt/lib/grunt/task.js:264:15)
# at Object.thisTask.fn (/srv/app-dev/app/client/node_modules/grunt/lib/grunt/task.js:82:16)
# at Object.<anonymous> (/srv/app-dev/app/client/node_modules/grunt/lib/util/task.js:282:30)
# Aborted due to warnings.
module.exports = function (grunt) {
var
config,
libPaths,
libPathsBase
;
libPaths = {};
require('matchdep')
.filterDev('grunt-*')
.forEach(grunt.task.loadNpmTasks)
;
grunt.task.loadTasks('./tasks');
libPathsBase = './bower_components/';
libPaths.ember = (libPathsBase + 'ember/ember.min.js');
libPaths.emberTemplateCompiler = (libPathsBase + 'ember-template-compiler/index.js');
libPaths.fabric = (libPathsBase + 'fabric/dist/all.min.js');
libPaths.handlebars = (libPathsBase + 'handlebars/handlebars.min.js');
libPaths.handlebarsRuntime = (libPathsBase + 'handlebars/handlebars.runtime.min.js');
libPaths.jquery = (libPathsBase + 'jquery/dist/jquery.min.js');
config = {
browserify: {
dev: {
files: {
'./build/application.js': [
'./app/.index.js'
]
},
options: {
debug: true
}
},
options: {
noParse: [
libPaths.fabric
],
shim: {}
}
},
clean: {
build: [
'./build'
]
},
connect: {
dev: {
options: {
keepalive: true
}
},
options: {
debug: true,
port: 8888
}
},
emberTemplates: {
app: {
files: {
'./app/.templates.js': './app/templates/{,*/}*.hbs'
},
options: {
templateBasePath: './app/templates/'
}
},
options: {
handlebarsPath: libPaths.handlebars,
templateCompilerPath: libPaths.emberTemplateCompiler
}
},
watch: {
js: {
files: [
'app/**/*.js'
],
tasks: [
'browserify'
]
},
templates: {
files: [
'app/templates/**/*.hbs'
],
tasks: [
'emberTemplates:app',
'browserify'
]
}
}
};
config
.browserify
.options
.shim[libPaths.ember] = {
depends: [
(libPaths.jquery + ':$'),
(libPaths.handlebars + ':Handlebars')
],
exports: 'Em'
}
;
config
.browserify
.options
.shim[libPaths.fabric] = {
exports: 'fabric'
}
;
config
.browserify
.options
.shim[libPaths.handlebars] = {
exports: 'Handlebars'
}
;
config
.browserify
.options
.shim[libPaths.jquery] = {
exports: '$'
}
;
grunt.config.init(config);
grunt.task.registerTask('build', [
'clean:build',
'emberTemplates',
'build-index',
'browserify'
]);
grunt.task.registerTask('serve', [
'connect:dev'
]);
grunt.task.registerTask('default', [
'build',
'watch'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment