mirror of
https://github.com/videojs/video.js.git
synced 2025-05-13 22:16:49 +02:00
Grunt improvements
Get test/index.html working when loaded directly into a browser. Remove extra browserifying via karma. Add timing info to to grunt output.
This commit is contained in:
parent
b5968f13e2
commit
54519da32c
64
Gruntfile.js
64
Gruntfile.js
@ -1,4 +1,6 @@
|
|||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
require('time-grunt')(grunt);
|
||||||
|
|
||||||
var pkg = grunt.file.readJSON('package.json');
|
var pkg = grunt.file.readJSON('package.json');
|
||||||
var license = grunt.file.read('build/license-header.txt');
|
var license = grunt.file.read('build/license-header.txt');
|
||||||
var verParts = pkg.version.split('.');
|
var verParts = pkg.version.split('.');
|
||||||
@ -269,7 +271,19 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
browserify: {
|
browserify: {
|
||||||
|
build: {
|
||||||
|
files: {
|
||||||
|
'build/temp/video.js': ['src/js/video.js']
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
|
browserifyOptions: {
|
||||||
|
debug: true,
|
||||||
|
standalone: 'videojs'
|
||||||
|
},
|
||||||
|
banner: license,
|
||||||
|
plugin: [
|
||||||
|
[ 'browserify-derequire' ]
|
||||||
|
],
|
||||||
transform: [
|
transform: [
|
||||||
require('babelify').configure({
|
require('babelify').configure({
|
||||||
sourceMapRelative: './src/js'
|
sourceMapRelative: './src/js'
|
||||||
@ -283,28 +297,19 @@ module.exports = function(grunt) {
|
|||||||
version: version.majorMinor
|
version: version.majorMinor
|
||||||
}]
|
}]
|
||||||
]
|
]
|
||||||
},
|
|
||||||
build: {
|
|
||||||
files: {
|
|
||||||
'build/temp/video.js': ['src/js/video.js']
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
browserifyOptions: {
|
|
||||||
debug: true,
|
|
||||||
standalone: 'videojs'
|
|
||||||
},
|
|
||||||
banner: license,
|
|
||||||
plugin: [
|
|
||||||
[ 'browserify-derequire' ]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
files: {
|
files: {
|
||||||
'build/temp/tests.js': [
|
'build/temp/tests.js': [
|
||||||
'test/globals-shim.js',
|
'test/globals-shim.js',
|
||||||
'test/unit/**/*.js',
|
'test/unit/**/*.js'
|
||||||
'test/api/**.js'
|
]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
transform: [
|
||||||
|
require('babelify').configure(),
|
||||||
|
'browserify-istanbul'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,6 +324,8 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
coveralls: {
|
coveralls: {
|
||||||
options: {
|
options: {
|
||||||
|
// warn instead of failing when coveralls errors
|
||||||
|
// we've seen coveralls 503 relatively frequently
|
||||||
force: true
|
force: true
|
||||||
},
|
},
|
||||||
all: {
|
all: {
|
||||||
@ -336,29 +343,8 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-videojs-languages');
|
// load all the npm grunt tasks
|
||||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
require('load-grunt-tasks')(grunt);
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
||||||
grunt.loadNpmTasks('grunt-sass');
|
|
||||||
grunt.loadNpmTasks('grunt-karma');
|
|
||||||
grunt.loadNpmTasks('videojs-doc-generator');
|
|
||||||
grunt.loadNpmTasks('grunt-zip');
|
|
||||||
grunt.loadNpmTasks('grunt-banner');
|
|
||||||
grunt.loadNpmTasks('grunt-version');
|
|
||||||
grunt.loadNpmTasks('chg');
|
|
||||||
grunt.loadNpmTasks('grunt-fastly');
|
|
||||||
grunt.loadNpmTasks('grunt-github-releaser');
|
|
||||||
grunt.loadNpmTasks('grunt-aws-s3');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
||||||
grunt.loadNpmTasks('grunt-browserify');
|
|
||||||
grunt.loadNpmTasks('grunt-coveralls');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
||||||
grunt.loadNpmTasks('grunt-exorcise');
|
|
||||||
|
|
||||||
grunt.registerTask('build', [
|
grunt.registerTask('build', [
|
||||||
'clean:build',
|
'clean:build',
|
||||||
|
@ -71,8 +71,10 @@
|
|||||||
"karma-safari-launcher": "^0.1.1",
|
"karma-safari-launcher": "^0.1.1",
|
||||||
"karma-sauce-launcher": "^0.2.8",
|
"karma-sauce-launcher": "^0.2.8",
|
||||||
"karma-sinon": "^1.0.3",
|
"karma-sinon": "^1.0.3",
|
||||||
|
"load-grunt-tasks": "^3.1.0",
|
||||||
"qunitjs": "~1.14.0",
|
"qunitjs": "~1.14.0",
|
||||||
"sinon": "~1.9.1",
|
"sinon": "~1.9.1",
|
||||||
|
"time-grunt": "^1.1.1",
|
||||||
"uglify-js": "~2.3.6",
|
"uglify-js": "~2.3.6",
|
||||||
"videojs-doc-generator": "0.0.1"
|
"videojs-doc-generator": "0.0.1"
|
||||||
}
|
}
|
||||||
|
@ -72,9 +72,6 @@ var videojs = function(id, options, ready){
|
|||||||
return tag['player'] || new Player(tag, options, ready);
|
return tag['player'] || new Player(tag, options, ready);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Extended name, also available externally, window.videojs
|
|
||||||
// var videojs = window['videojs'] = vjs;
|
|
||||||
|
|
||||||
// CDN Version. Used to target right flash swf.
|
// CDN Version. Used to target right flash swf.
|
||||||
videojs.CDN_VERSION = '__VERSION_NO_PATCH__';
|
videojs.CDN_VERSION = '__VERSION_NO_PATCH__';
|
||||||
videojs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
|
videojs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
q.module('Player Minified');
|
q.module('Player API');
|
||||||
|
|
||||||
test('videojs should exist on the window', function() {
|
test('videojs should exist on the window', function() {
|
||||||
ok(window.videojs, 'videojs exists on the window');
|
ok(window.videojs, 'videojs exists on the window');
|
||||||
|
@ -9,7 +9,12 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="qunit"></div>
|
<div id="qunit"></div>
|
||||||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||||
|
|
||||||
|
<!-- Execute the bundled tests first -->
|
||||||
<script src="../build/temp/tests.js"></script>
|
<script src="../build/temp/tests.js"></script>
|
||||||
|
|
||||||
|
<!-- Include the video.js globals to run the API tests against -->
|
||||||
|
<script src="../build/temp/video.min.js"></script>
|
||||||
<script src="api/api.js"></script>
|
<script src="api/api.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -50,27 +50,22 @@ module.exports = function(config) {
|
|||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
|
|
||||||
frameworks: ['browserify', 'qunit'],
|
frameworks: ['qunit'],
|
||||||
|
|
||||||
autoWatch: false,
|
autoWatch: false,
|
||||||
|
|
||||||
singleRun: true,
|
singleRun: true,
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
|
// include and execute the standalone test bundle first
|
||||||
|
'../build/temp/tests.js',
|
||||||
|
|
||||||
|
// then include video.js through globals to run the API tests
|
||||||
'../build/temp/video-js.min.css',
|
'../build/temp/video-js.min.css',
|
||||||
'../build/temp/video.min.js',
|
'../build/temp/video.min.js',
|
||||||
'../build/temp/tests.js',
|
'api/api.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
preprocessors: {
|
|
||||||
'../test/unit/**/*.js': [ 'browserify' ]
|
|
||||||
},
|
|
||||||
|
|
||||||
browserify: {
|
|
||||||
debug: true,
|
|
||||||
transform: [ 'babelify', 'browserify-istanbul' ]
|
|
||||||
},
|
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
'karma-qunit',
|
'karma-qunit',
|
||||||
'karma-chrome-launcher',
|
'karma-chrome-launcher',
|
||||||
@ -80,7 +75,6 @@ module.exports = function(config) {
|
|||||||
'karma-phantomjs-launcher',
|
'karma-phantomjs-launcher',
|
||||||
'karma-safari-launcher',
|
'karma-safari-launcher',
|
||||||
'karma-sauce-launcher',
|
'karma-sauce-launcher',
|
||||||
'karma-browserify',
|
|
||||||
'karma-coverage'
|
'karma-coverage'
|
||||||
],
|
],
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user