Skip to content

Commit

Permalink
Setup webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Brodsky committed Mar 6, 2017
1 parent c15e1f5 commit cd24123
Show file tree
Hide file tree
Showing 6 changed files with 772 additions and 1,034 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ npm-debug.log
.npmrc

examples
dist
build/**/*
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!dist/**
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
"name": "cuepoints",
"title": "VideoJS Cuepoints plugin",
"distName": "videojs.cuepoints",
"version": "1.2.0-vy.2",
"version": "1.2.0-vy-1",
"author": "Carlos Galan Cladera <cgcladera@gmail.com>",
"license": "MIT",
"github_url": "http://github.com/VadimBrodsky/videojs-cuepoints",
"main": "src/core.cuepoint.js",
"main": "dist/videojs.cuepoints.js",
"module": "src/core.js",
"scripts": {
"bundle": "webpack",
"prepublish": "yarn bundle"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-nodeunit": "^1.0.0",
"grunt-contrib-uglify": "^2.2.0"
"webpack": "^2.2.1"
},
"dependencies": {
"video.js": "5.17.*"
Expand Down
8 changes: 6 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import videojs from 'video.js';
import Cuepoint from './cuepoints';
import Cuepoint from './cuepoint';

function vjsCuepoints(options) {
var player = this;
Expand Down Expand Up @@ -34,4 +34,8 @@ function vjsCuepoints(options) {
player.cuepoints.init(options);
}

videojs.plugin('cuepoints', vjsCuepoints);
(function registerPlugin() {
videojs.plugin('cuepoints', vjsCuepoints);
})();

export { vjsCuepoints as default };
14 changes: 14 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const path = require('path');

module.exports = {
entry: './src/core.js',
output: {
filename: 'videojs.cuepoints.js',
path: path.resolve(__dirname, 'dist'),
library: 'cuepoints',
libraryTarget: 'umd'
},
externals: {
'video.js': 'video.js'
}
};
Loading

0 comments on commit cd24123

Please sign in to comment.