Skip to content

Commit 51848e6

Browse files
committed
use gulp-umd
1 parent 2e1fe52 commit 51848e6

File tree

3 files changed

+45
-44
lines changed

3 files changed

+45
-44
lines changed

dist/angular-wt-genius-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-wt-genius.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
11
;(function(root, factory) {
22
if (typeof define === 'function' && define.amd) {
3-
define(['Notify'], factory);
3+
define(['notify.js/dist/notify.js'], factory);
44
} else if (typeof exports === 'object') {
5-
module.exports = factory(require('Notify'));
5+
module.exports = factory(require('notify.js/dist/notify.js'));
66
} else {
77
root.wtGenius = factory(root.Notify);
88
}
99
}(this, function(Notify) {
1010
var wtGenius = angular.module('wt.genius', []);
11+
/**
12+
* $wtRetina
13+
*
14+
* Version: 1.0.0 - 2015-10-19
15+
* Anthor: zhenshuai
16+
*/
17+
angular.module('wt.genius')
18+
.provider('$wtRetina', [function () {
19+
var defaults = {
20+
onchange: function () {
21+
//console.log('dpi 切换事件');
22+
}
23+
};
24+
var configOptions = {};
25+
this.config = function (value) {
26+
configOptions = value;
27+
};
28+
this.$get = [
29+
function () {
30+
var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\
31+
(-o-min-device-pixel-ratio: 3/2),\
32+
(-webkit-min-device-pixel-ratio: 1.5),\
33+
(min-device-pixel-ratio: 1.5),\
34+
(min-resolution: 144dpi),\
35+
(min-resolution: 1.5dppx)";
36+
37+
var matchObj = window.matchMedia(mediaQuery);
38+
return {
39+
isRetina: matchObj.matches,
40+
media : matchObj.media
41+
};
42+
}
43+
];
44+
}]);
1145
/**
1246
* $wtNotify
1347
*
@@ -91,39 +125,5 @@ angular.module('wt.genius')
91125
return result;
92126
}];
93127
}]);
94-
/**
95-
* $wtRetina
96-
*
97-
* Version: 1.0.0 - 2015-10-19
98-
* Anthor: zhenshuai
99-
*/
100-
angular.module('wt.genius')
101-
.provider('$wtRetina', [function () {
102-
var defaults = {
103-
onchange: function () {
104-
//console.log('dpi 切换事件');
105-
}
106-
};
107-
var configOptions = {};
108-
this.config = function (value) {
109-
configOptions = value;
110-
};
111-
this.$get = [
112-
function () {
113-
var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\
114-
(-o-min-device-pixel-ratio: 3/2),\
115-
(-webkit-min-device-pixel-ratio: 1.5),\
116-
(min-device-pixel-ratio: 1.5),\
117-
(min-resolution: 144dpi),\
118-
(min-resolution: 1.5dppx)";
119-
120-
var matchObj = window.matchMedia(mediaQuery);
121-
return {
122-
isRetina: matchObj.matches,
123-
media : matchObj.media
124-
};
125-
}
126-
];
127-
}]);
128128
return wtGenius;
129129
}));

gulpfile.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var concat = require('gulp-concat');
77
var uglify = require('gulp-uglify');
88
var plumber = require('gulp-plumber');
99
var umd = require('gulp-umd');
10+
1011
//var del = require('del');
1112

1213

@@ -25,7 +26,7 @@ gulp.task('style', function () {
2526
.pipe(concat('angular-wt-genius-min.css'))
2627
.pipe(autoprefixer({
2728
browsers: ['last 2 versions'],
28-
cascade : false
29+
cascade: false
2930
}))
3031
.pipe(gulp.dest('./dist/'));
3132
});
@@ -34,18 +35,18 @@ gulp.task('js', function () {
3435
.pipe(plumber({errorHandler: error}))
3536
.pipe(concat('angular-wt-genius.js'))
3637
.pipe(umd({
37-
exports: function(file) {
38+
exports: function (file) {
3839
return 'wtGenius';
3940
},
40-
namespace: function(file) {
41+
namespace: function (file) {
4142
return 'wtGenius';
4243
},
43-
dependencies: function(file) {
44+
dependencies: function (file) {
4445
return [
4546
{
46-
name: 'Notify',
47-
amd: 'Notify',
48-
cjs: 'Notify',
47+
name: 'notify.js/dist/notify.js',
48+
amd: 'notify.js/dist/notify.js',
49+
cjs: 'notify.js/dist/notify.js',
4950
global: 'Notify',
5051
param: 'Notify'
5152
}

0 commit comments

Comments
 (0)