Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit b460ce0

Browse files
committed
initial commit
1 parent 453a617 commit b460ce0

File tree

20 files changed

+1899
-113
lines changed

20 files changed

+1899
-113
lines changed

Gruntfile.js

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
1616
handlebars: {
1717
compile: {
1818
options: {
19-
amd: ['handlebars'],
19+
//amd: ['handlebars'],
2020
namespace: 'JST',
2121
// Registers all files that start with '_' as a partial.
2222
partialRegex: /^_/,
@@ -30,11 +30,45 @@ module.exports = function(grunt) {
3030
}
3131
},
3232
files: {
33-
'src/assets/scripts/templates.js': 'src/templates/*.hbs'
33+
'src/assets/scripts/templates.js': 'src/assets/templates/**/*.hbs'
3434
}
3535
}
3636
},
3737

38+
browserify: {
39+
web: {
40+
options: {
41+
},
42+
bundleOptions: {
43+
debug: true
44+
},
45+
files: {
46+
'web/assets/scripts/main.js': ['src/assets/scripts/main.js']
47+
}
48+
}
49+
},
50+
51+
clean: {
52+
web: ['web']
53+
},
54+
55+
copy: {
56+
styles: {
57+
files: [{
58+
expand: true,
59+
cwd: 'src',
60+
dest: 'web/',
61+
src: [
62+
'index.html',
63+
'assets/media/**',
64+
'assets/vendor/todomvc-common/bg.png',
65+
'assets/{styles,vendor}/**/*.css',
66+
'!assets/vendor/structurejs/**/*.css'
67+
]
68+
}]
69+
}
70+
},
71+
3872
/**
3973
* Creates a node.js Express Server to test our code in a server like environment.
4074
* Note: We are using the watch task to keep the server running.
@@ -78,19 +112,27 @@ module.exports = function(grunt) {
78112
});
79113

80114
// These plugins provide necessary tasks.
115+
grunt.loadNpmTasks('grunt-contrib-clean');
116+
grunt.loadNpmTasks('grunt-contrib-copy');
117+
grunt.loadNpmTasks('grunt-browserify');
81118
grunt.loadNpmTasks('grunt-contrib-watch');
82119
grunt.loadNpmTasks('grunt-express');
83120
grunt.loadNpmTasks('grunt-open');
84121
grunt.loadNpmTasks('grunt-contrib-handlebars');
85122

86123
// Default task
87124
grunt.registerTask('default', [
125+
'clean',
126+
'browserify',
88127
'handlebars',
89-
'watch'
128+
'copy'
90129
]);
91130

92131
grunt.registerTask('launch', [
132+
'clean',
133+
'browserify',
93134
'handlebars',
135+
'copy',
94136
'express',
95137
'open',
96138
'watch'

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,28 @@
66
"scripts": {},
77
"author": "",
88
"license": "ISC",
9+
"browser": {
10+
"jquery": "./src/assets/vendor/jquery/dist/jquery.min.js",
11+
"handlebars": "./src/assets/vendor/handlebars/handlebars.runtime.min.js",
12+
"templates": "./src/assets/scripts/templates.js"
13+
},
14+
"browserify-shim": {
15+
"jquery": "global:$",
16+
"Handlebars": "global:Handlebars",
17+
"three": "global:THREE"
18+
},
19+
"browserify": {
20+
"transform": [
21+
"browserify-shim"
22+
]
23+
},
924
"devDependencies": {
25+
"browserify": "^10.0.0",
26+
"browserify-shim": "^3.8.6",
1027
"grunt": "^0.4.5",
28+
"grunt-browserify": "^3.7.0",
29+
"grunt-contrib-clean": "^0.6.0",
30+
"grunt-contrib-copy": "^0.8.0",
1131
"grunt-contrib-handlebars": "~0.9.3",
1232
"grunt-contrib-watch": "~0.6.1",
1333
"grunt-express": "^1.4.1",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy