Skip to content

Commit 53af5d0

Browse files
committed
Merge branch 'feature/umd-pattern'
2 parents 95429e4 + 9764d52 commit 53af5d0

5 files changed

+26
-13
lines changed

Gruntfile.js

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
var config = {
2+
instanceName: {
3+
highlightjs: 'hljs',
4+
angular: 'angular'
5+
},
6+
npmName: {
7+
highlightjs: 'highlight.js',
8+
angular: 'angular'
9+
},
10+
moduleName: 'hljs'
11+
};
12+
113
module.exports = function(grunt) {
214
grunt.initConfig({
3-
modulename: 'hljs',
15+
config: config,
416
pkg: grunt.file.readJSON('package.json'),
17+
518
dir: {
619
src: 'src',
720
build: 'build'
@@ -23,15 +36,15 @@ module.exports = function(grunt) {
2336
banner: '<%= meta.banner %>\n\n'+
2437
'(function (root, factory) {\n'+
2538
' if (typeof define === "function" && define.amd) {\n'+
26-
' define(["angular", "hljs"], factory);\n'+
39+
' define(["<%= config.npmName.angular %>", "<%= config.npmName.highlightjs %>"], factory);\n'+
2740
' } else if (typeof module === "object" && module.exports) {\n'+
28-
' module.exports = factory(require("angular"), require("highlight.js"));\n'+
41+
' module.exports = factory(require("<%= config.npmName.angular %>"), require("<%= config.npmName.highlightjs %>"));\n'+
2942
' } else {\n'+
30-
' root.returnExports = factory(root.angular, root.hljs);\n'+
43+
' root.returnExports = factory(root.<%= config.instanceName.angular %>, root.<%= config.instanceName.highlightjs %>);\n'+
3144
' }\n'+
3245
'}(this, function (angular, hljs) {\n\n',
3346
footer: '\n\n'+
34-
' return "<%= modulename %>";\n'+
47+
' return "<%= config.moduleName %>";\n'+
3548
'}));'
3649
},
3750
build: {

angular-highlightjs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*! angular-highlightjs
22
version: 0.4.1
3-
build date: 2015-07-25
3+
build date: 2015-07-27
44
author: Chih-Hsuan Fan
55
https://github.com/pc035860/angular-highlightjs.git */
66

77
(function (root, factory) {
88
if (typeof define === "function" && define.amd) {
9-
define(["angular", "hljs"], factory);
9+
define(["angular", "highlight.js"], factory);
1010
} else if (typeof module === "object" && module.exports) {
1111
module.exports = factory(require("angular"), require("highlight.js"));
1212
} else {

angular-highlightjs.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/angular-highlightjs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*! angular-highlightjs
22
version: 0.4.1
3-
build date: 2015-07-25
3+
build date: 2015-07-27
44
author: Chih-Hsuan Fan
55
https://github.com/pc035860/angular-highlightjs.git */
66

77
(function (root, factory) {
88
if (typeof define === "function" && define.amd) {
9-
define(["angular", "hljs"], factory);
9+
define(["angular", "highlight.js"], factory);
1010
} else if (typeof module === "object" && module.exports) {
1111
module.exports = factory(require("angular"), require("highlight.js"));
1212
} else {

build/angular-highlightjs.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)