Skip to content

Commit d3ed1b4

Browse files
Improved build by using almond
1 parent 78e7ec1 commit d3ed1b4

File tree

5 files changed

+39
-47
lines changed

5 files changed

+39
-47
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
bower_components/

Gruntfile.coffee

+29-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ module.exports = (grunt)->
1919
clean:
2020
dist: ['<%= config.dist %>']
2121
test: ['<%= config.test_dist %>']
22-
global: ['<%= config.dist %>/helpers', '<%= config.dist %>/temp', '<%= config.dist %>/amd/all.js', '<%= config.dist %>/node/all.js']
22+
global: [
23+
'<%= config.dist %>/helpers',
24+
'<%= config.dist %>/temp',
25+
'<%= config.dist %>/amd/all.js',
26+
'<%= config.dist %>/amd/almond.js',
27+
'<%= config.dist %>/node/all.js',
28+
'<%= config.dist %>/node/almond.js'
29+
]
2330

2431
coffee:
2532
dist:
@@ -28,12 +35,6 @@ module.exports = (grunt)->
2835
src: ['**/*.coffee']
2936
dest: '<%= config.dist %>/amd'
3037
ext: '.js'
31-
help:
32-
expand: true
33-
cwd: '<%= config.helpers %>'
34-
src: ['**/*.coffee']
35-
dest: '<%= config.dist %>/helpers'
36-
ext: '.js'
3738
test:
3839
expand: true
3940
cwd: '<%= config.test %>'
@@ -52,6 +53,21 @@ module.exports = (grunt)->
5253
files: [
5354
{ expand: true, cwd: '.', src: ['package.json'], dest: '<%= config.dist %>/node' }
5455
{ expand: true, cwd: '.', src: ['README.md'], dest: '<%= config.dist %>/node' }
56+
{
57+
expand: false,
58+
cwd: '.',
59+
src: ['<%= config.dist %>/temp/almond.js'],
60+
dest: '<%= config.dist %>/global/paths.js'
61+
}
62+
]
63+
almond:
64+
files:[
65+
{
66+
expand: false,
67+
cwd: '.',
68+
src: ['bower_components/almond/almond.js'],
69+
dest: '<%= config.dist %>/amd/almond.js'
70+
}
5571
]
5672

5773
concat:
@@ -72,7 +88,10 @@ module.exports = (grunt)->
7288
appDir: '<%= config.dist %>/amd'
7389
dir: '<%= config.dist %>/temp'
7490
skipDirOptimize: true
75-
modules: [{ name: 'all' }]
91+
deps: ['all']
92+
insertRequire: ['all']
93+
name: 'almond'
94+
# modules: [{ name: 'all' }]
7695

7796
watch:
7897
dist:
@@ -97,13 +116,12 @@ module.exports = (grunt)->
97116

98117
grunt.registerTask 'build', [
99118
'clean:dist'
100-
'coffee:help'
101119
'coffee:dist'
120+
'copy:almond'
102121
'requirejs:compile'
103122
'urequire:dist'
104123
'copy:dist'
105-
'concat:global'
106124
'clean:global'
107125
]
108-
126+
109127
grunt.registerTask 'default', ['test']

bower.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
"package.json"
1010
],
1111
"dependencies": {},
12-
"devDependencies": {}
12+
"devDependencies": {
13+
"almond": "~0.2.9"
14+
}
1315
}

0 commit comments

Comments
 (0)