videojs-mobile-ui 1.2.0-alpha.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +104 -53
  2. package/dist/lang/de.js +1 -3
  3. package/dist/lang/en.js +1 -3
  4. package/dist/lang/it.js +1 -3
  5. package/dist/videojs-mobile-ui.cjs.js +195 -43
  6. package/dist/videojs-mobile-ui.css +104 -2
  7. package/dist/videojs-mobile-ui.es.js +195 -43
  8. package/dist/videojs-mobile-ui.js +204 -53
  9. package/dist/videojs-mobile-ui.min.js +2 -2
  10. package/docs/api/TouchOverlay.html +772 -0
  11. package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
  12. package/docs/api/fonts/OpenSans-Bold-webfont.svg +1830 -0
  13. package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
  14. package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  15. package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  16. package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  17. package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
  18. package/docs/api/fonts/OpenSans-Italic-webfont.svg +1830 -0
  19. package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
  20. package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
  21. package/docs/api/fonts/OpenSans-Light-webfont.svg +1831 -0
  22. package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
  23. package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  24. package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  25. package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  26. package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
  27. package/docs/api/fonts/OpenSans-Regular-webfont.svg +1831 -0
  28. package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
  29. package/docs/api/global.html +1485 -0
  30. package/docs/api/index.html +159 -0
  31. package/docs/api/plugin.js.html +266 -0
  32. package/docs/api/scripts/linenumber.js +25 -0
  33. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  34. package/docs/api/scripts/prettify/lang-css.js +2 -0
  35. package/docs/api/scripts/prettify/prettify.js +28 -0
  36. package/docs/api/styles/jsdoc-default.css +358 -0
  37. package/docs/api/styles/prettify-jsdoc.css +111 -0
  38. package/docs/api/styles/prettify-tomorrow.css +132 -0
  39. package/docs/api/swipeFullscreen.js.html +173 -0
  40. package/docs/api/touchOverlay.js.html +203 -0
  41. package/index.html +238 -170
  42. package/package.json +23 -13
  43. package/scripts/lang.js +24 -0
  44. package/scripts/netlify.js +16 -0
  45. package/scripts/postcss.config.js +29 -5
  46. package/scripts/readme-options.js +370 -0
  47. package/scripts/rollup.config.js +0 -8
  48. package/src/plugin.css +6 -0
  49. package/src/plugin.js +65 -39
  50. package/src/swipeFullscreen.js +122 -0
  51. package/src/touchOverlay.js +7 -3
  52. package/test/plugin.test.js +125 -18
  53. package/test/swipeFullscreen.test.js +365 -0
package/index.html CHANGED
@@ -1,9 +1,11 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
+
3
4
  <head>
4
5
  <meta charset="utf-8" />
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
7
  <title>videojs-mobile-ui Demo</title>
8
+ <link href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%231f1f1f%22%3E%3Cpath%20d%3D%22M419-80q-28%200-52.5-12T325-126L124-381q-8-9-7-21.5t9-20.5q20-21%2048-25t52%2011l74%2045v-328q0-17%2011.5-28.5T340-760q17%200%2029%2011.5t12%2028.5v200h299q50%200%2085%2035t35%2085v160q0%2066-47%20113T640-80H419Zm60-520q-17%200-28.5-11.5T439-640q0-2%205-20%208-14%2012-28.5t4-31.5q0-50-35-85t-85-35q-50%200-85%2035t-35%2085q0%2017%204%2031.5t12%2028.5q3%205%204%2010t1%2010q0%2017-11%2028.5T202-600q-11%200-20.5-6T167-621q-13-22-20-47t-7-52q0-83%2058.5-141.5T340-920q83%200%20141.5%2058.5T540-720q0%2027-7%2052t-20%2047q-5%209-14%2015t-20%206Z%22%2F%3E%3C%2Fsvg%3E" rel="icon" type="image/x-icon" />
7
9
  <link href="node_modules/video.js/dist/video-js.css" rel="stylesheet" />
8
10
  <link href="dist/videojs-mobile-ui.css" rel="stylesheet" />
9
11
  <style>
@@ -15,186 +17,252 @@
15
17
  pointer-events: none;
16
18
  display: none;
17
19
  }
20
+
21
+ body {
22
+ font-size: 16px;
23
+ line-height: 1.4;
24
+ margin-bottom: 60px;
25
+ }
26
+
27
+ .video-container {
28
+ width: 100vw;
29
+ margin-left: calc(50% - 50vw);
30
+ }
31
+
32
+ video-js:fullscreen .vjs-control-bar {
33
+ font-size: 1.1em;
34
+ padding-bottom: 20px;
35
+ height: calc(3em + 20px);
36
+ }
37
+
38
+ #demoOptions {
39
+
40
+ ul {
41
+ list-style: none;
42
+ padding: 0;
43
+ margin: 0;
44
+ }
45
+
46
+ li {
47
+ margin-bottom: 10px;
48
+ }
49
+
50
+ label {
51
+ min-height: 44px;
52
+ /* Apple/Google tap target guidance */
53
+ cursor: pointer;
54
+ font-family: ui-monospace, 'Courier New', Courier, monospace;
55
+ }
56
+
57
+ /* Text inputs */
58
+ input[type="text"],
59
+ input[type="email"],
60
+ input[type="number"],
61
+ input[type="password"],
62
+ textarea {
63
+ width: 90%;
64
+ padding: 10px 12px;
65
+ font-size: 16px;
66
+ /* Prevents iOS zoom */
67
+ border: 1px solid #ccc;
68
+ border-radius: 6px;
69
+ }
70
+
71
+ /* Checkboxes (simple but usable) */
72
+ input[type="checkbox"] {
73
+ width: 20px;
74
+ height: 20px;
75
+ flex-shrink: 0;
76
+ }
77
+
78
+ /* Optional: subtle focus style */
79
+ input:focus,
80
+ textarea:focus {
81
+ outline: none;
82
+ border-color: #007aff;
83
+ /* iOS blue */
84
+ }
85
+
86
+ /* Optional: slightly separate groups */
87
+ li+li {
88
+ border-top: 1px solid #eee;
89
+ padding-top: 8px;
90
+ }
91
+
92
+ button {
93
+ font-size: 16px;
94
+ margin-bottom: 10px;
95
+ }
96
+ }
18
97
  </style>
19
98
  </head>
99
+
20
100
  <body>
21
- <video-js
22
- id="videojs-mobile-ui-player"
23
- class="video-js vjs-default-skin vjs-fluid"
24
- controls
25
- playsinline
26
- >
27
- <source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegurl" />
28
- </video-js>
29
- <ul>
30
- <li><a href="test/">Run unit tests in browser.</a></li>
31
- <li><a href="docs/api/">Read generated docs.</a></li>
32
- </ul>
33
- <h2>Options</h2>
34
- <ul id="options">
35
- <li>fullscreen:</li>
101
+ <h1>videojs-mobile-ui test page.</h1>
102
+ <div class="video-container">
103
+ <video-js id="videojs-mobile-ui-player" class="video-js vjs-default-skin vjs-fluid" controls playsinline>
104
+ <source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8"
105
+ type="application/x-mpegurl" />
106
+ </video-js>
107
+ </div>
36
108
  <ul>
37
- <li>
38
- <input
39
- type="checkbox"
40
- data-section="fullscreen"
41
- id="enterOnRotate"
42
- />enterOnRotate
43
- </li>
44
- <li>
45
- <input
46
- type="checkbox"
47
- data-section="fullscreen"
48
- id="exitOnRotate"
49
- />exitOnRotate
50
- </li>
51
- <li>
52
- <input
53
- type="checkbox"
54
- data-section="fullscreen"
55
- id="lockOnRotate"
56
- />lockOnRotate
57
- </li>
58
- <li>
59
- <input
60
- type="checkbox"
61
- data-section="fullscreen"
62
- id="alwaysLockToLandscape"
63
- />alwaysLockToLandscape
64
- </li>
65
- <li>
66
- <input
67
- type="checkbox"
68
- data-section="fullscreen"
69
- id="fullscreenDisabled"
70
- />disabled
71
- </li>
109
+ <li><a href="test/">Run unit tests in browser.</a></li>
72
110
  </ul>
73
- <li>touchControls:</li>
74
- <ul>
75
- <li>
76
- <input
77
- type="number"
78
- data-section="touchControls"
79
- id="seekSeconds"
80
- />seekSeconds
81
- </li>
82
- <li>
83
- <input
84
- type="number"
85
- data-section="touchControls"
86
- id="tapTimeout"
87
- />tapTimeout
88
- </li>
89
- <li>
90
- <input
91
- type="checkbox"
92
- data-section="touchControls"
93
- id="disableOnEnd"
94
- />disableOnEnd
95
- </li>
96
- <li>
97
- <input
98
- type="checkbox"
99
- data-section="touchControls"
100
- id="touchControlsDisabled"
101
- />disabled
102
- </li>
103
- </ul>
104
- </ul>
105
- <button id="reload">Reload with options</button>
106
- <ul id="log"></ul>
107
- <script src="node_modules/video.js/dist/video.js"></script>
108
- <script src="dist/videojs-mobile-ui.js"></script>
109
- <script>
110
- (function (window, videojs) {
111
- var options = {
112
- fullscreen: {
113
- enterOnRotate: true,
114
- exitOnRotate: true,
115
- lockOnRotate: true,
116
- alwaysLockToLandscape: false,
117
- disabled: false,
118
- },
119
- touchControls: {
120
- seekSeconds: 10,
121
- tapTimeout: 300,
122
- disableOnEnd: false,
123
- disabled: false,
124
- },
125
- };
126
-
127
- var url = new URL(window.location);
128
- if (url.searchParams.has('options')) {
129
- options = JSON.parse(url.searchParams.get('options'));
130
- }
111
+ <h2>Options</h2>
112
+ <div id="demoOptions">
113
+ <p>Reload to apply changed options.</p>
114
+ <button id="reload">Reload with options</button>
115
+ <ul id="options">
116
+ <li>
117
+ <h3>fullscreen:</h3>
118
+ </li>
119
+ <ul>
120
+ <li>
121
+ <input type="checkbox" data-section="fullscreen" id="enterOnRotate" /> <label for="enterOnRotate">enterOnRotate</label>
122
+ </li>
123
+ <li>
124
+ <input type="checkbox" data-section="fullscreen" id="exitOnRotate" />
125
+ <label for="exitOnRotate">exitOnRotate</label>
126
+ </li>
127
+ <li>
128
+ <input type="checkbox" data-section="fullscreen" id="lockOnRotate" />
129
+ <label for="lockOnRotate">lockOnRotate</label>
130
+ </li>
131
+ <li>
132
+ <input type="checkbox" data-section="fullscreen" id="alwaysLockToLandscape" />
133
+ <label for="alwaysLockToLandscape">alwaysLockToLandscape</label>
134
+ </li>
135
+ <li>
136
+ <input type="checkbox" data-section="fullscreen" id="swipeToFullscreen" />
137
+ <label for="swipeToFullscreen">swipeToFullscreen</label>
138
+ </li>
139
+ <li>
140
+ <input type="checkbox" data-section="fullscreen" id="swipeFromFullscreen" />
141
+ <label for="swipeFromFullscreen">swipeFromFullscreen</label>
142
+ </li>
143
+ <li>
144
+ <input type="checkbox" data-section="fullscreen" id="fullscreenDisabled" />
145
+ <label for="disabled">disabled</label>
146
+ </li>
147
+ </ul>
148
+ <li>
149
+ <h3>touchControls:</h3>
150
+ </li>
151
+ <ul>
152
+ <li>
153
+ <input type="number" data-section="touchControls" id="seekSeconds" />
154
+ <label for="seekSeconds">seekSeconds</label>
155
+ </li>
156
+ <li>
157
+ <input type="number" data-section="touchControls" id="tapTimeout" />
158
+ <label for="tapTimeout">tapTimeout</label>
159
+ </li>
160
+ <li>
161
+ <input type="checkbox" data-section="touchControls" id="disableOnEnd" />
162
+ <label for="disableOnEnd">disableOnEnd</label>
163
+ </li>
164
+ <li>
165
+ <input type="checkbox" data-section="touchControls" id="touchControlsDisabled" />
166
+ <label for="disabled">disabled</label>
167
+ </li>
168
+ </ul>
169
+ </ul>
170
+ </div>
171
+ <ul id="log"></ul>
172
+ <script src="node_modules/video.js/dist/video.js"></script>
173
+ <script src="dist/videojs-mobile-ui.js"></script>
174
+ <script>
175
+ (function (window, videojs) {
176
+ var options = {
177
+ fullscreen: {
178
+ enterOnRotate: true,
179
+ exitOnRotate: true,
180
+ lockOnRotate: true,
181
+ alwaysLockToLandscape: false,
182
+ swipeToFullscreen: false,
183
+ swipeFromFullscreen: false,
184
+ disabled: false,
185
+ },
186
+ touchControls: {
187
+ seekSeconds: 10,
188
+ tapTimeout: 300,
189
+ disableOnEnd: false,
190
+ disabled: false,
191
+ },
192
+ };
193
+
194
+ var url = new URL(window.location);
195
+ if (url.searchParams.has('options')) {
196
+ options = JSON.parse(url.searchParams.get('options'));
197
+ }
131
198
 
132
- console.log(JSON.stringify(options, null, 2));
199
+ console.log(JSON.stringify(options, null, 2));
133
200
 
134
- Object.keys(options).forEach(function (section) {
135
- Object.keys(options[section]).forEach(function (prop) {
136
- const val = options[section][prop];
201
+ Object.keys(options).forEach(function (section) {
202
+ Object.keys(options[section]).forEach(function (prop) {
203
+ const val = options[section][prop];
137
204
 
138
- if (prop === 'disabled') {
139
- prop = `${section}Disabled`;
140
- }
205
+ if (prop === 'disabled') {
206
+ prop = `${section}Disabled`;
207
+ }
141
208
 
142
- if (typeof val === 'boolean') {
143
- document.getElementById(prop).checked = val;
144
- }
145
- if (typeof val === 'number') {
146
- document.getElementById(prop).value = val;
147
- }
209
+ if (typeof val === 'boolean') {
210
+ document.getElementById(prop).checked = val;
211
+ }
212
+ if (typeof val === 'number') {
213
+ document.getElementById(prop).value = val;
214
+ }
215
+ });
148
216
  });
149
- });
150
-
151
- document
152
- .getElementById('options')
153
- .querySelectorAll('input')
154
- .forEach(function (opt) {
155
- opt.addEventListener('change', function () {
156
- if (this.type === 'checkbox') {
157
- const param = this.id.endsWith('Disabled')
158
- ? 'disabled'
159
- : this.id;
160
-
161
- options[this.getAttribute('data-section')][param] =
162
- this.checked;
163
- } else {
164
- options[this.getAttribute('data-section')][this.id] =
165
- parseFloat(this.value);
166
- }
167
- console.log(options);
217
+
218
+ document
219
+ .getElementById('options')
220
+ .querySelectorAll('input')
221
+ .forEach(function (opt) {
222
+ opt.addEventListener('change', function () {
223
+ if (this.type === 'checkbox') {
224
+ const param = this.id.endsWith('Disabled')
225
+ ? 'disabled'
226
+ : this.id;
227
+
228
+ options[this.getAttribute('data-section')][param] =
229
+ this.checked;
230
+ } else {
231
+ options[this.getAttribute('data-section')][this.id] =
232
+ parseFloat(this.value);
233
+ }
234
+ console.log(options);
235
+ });
236
+ });
237
+
238
+ document
239
+ .getElementById('reload')
240
+ .addEventListener('click', function () {
241
+ url.searchParams.set('options', JSON.stringify(options));
242
+
243
+ window.location = url.href;
244
+ });
245
+
246
+ window.addEventListener('orientationchange', function () {
247
+ var el = document.createElement('li');
248
+ var message =
249
+ new Date().toTimeString().split(' ')[0] + ' ' + window.orientation;
250
+ message +=
251
+ screen && screen.orientation
252
+ ? ' ' + screen.orientation.type + ' ' + screen.orientation.angle
253
+ : '';
254
+ el.textContent = message;
255
+ console.log(message);
256
+ document.getElementById('log').appendChild(el);
168
257
  });
169
- });
170
-
171
- document
172
- .getElementById('reload')
173
- .addEventListener('click', function () {
174
- url.searchParams.set('options', JSON.stringify(options));
175
-
176
- window.location = url.href;
177
- });
178
-
179
- window.addEventListener('orientationchange', function () {
180
- var el = document.createElement('li');
181
- var message =
182
- new Date().toTimeString().split(' ')[0] + ' ' + window.orientation;
183
- message +=
184
- screen && screen.orientation
185
- ? ' ' + screen.orientation.type + ' ' + screen.orientation.angle
186
- : '';
187
- el.textContent = message;
188
- console.log(message);
189
- document.getElementById('log').appendChild(el);
190
- });
191
-
192
- var testPlayer = (window.testPlayer = videojs(
193
- 'videojs-mobile-ui-player'
258
+
259
+ var testPlayer = (window.testPlayer = videojs(
260
+ 'videojs-mobile-ui-player'
194
261
  ));
195
- testPlayer.endscreen = function () {};
196
- testPlayer.mobileUi(options);
197
- })(window, window.videojs);
198
- </script>
262
+ testPlayer.endscreen = function () { };
263
+ testPlayer.mobileUi(options);
264
+ })(window, window.videojs);
265
+ </script>
199
266
  </body>
200
- </html>
267
+
268
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videojs-mobile-ui",
3
- "version": "1.2.0-alpha.0",
3
+ "version": "1.2.0",
4
4
  "description": "Mobile tap controls and fullscreen on rotate for Video.js",
5
5
  "main": "dist/videojs-mobile-ui.cjs.js",
6
6
  "module": "dist/videojs-mobile-ui.es.js",
@@ -10,16 +10,16 @@
10
10
  "version": "8.0.0"
11
11
  },
12
12
  "scripts": {
13
- "build": "npm-run-all -s clean -p build:*",
13
+ "build": "npm-run-all -s clean -p docs:options -p build:*",
14
14
  "build-prod": "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
15
15
  "build-test": "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
16
16
  "build:css": "postcss -o dist/videojs-mobile-ui.css --config scripts/postcss.config.js src/plugin.css",
17
17
  "build:js": "rollup -c scripts/rollup.config.js",
18
- "build:lang": "vjslang --dir dist/lang",
18
+ "build:lang": "node ./scripts/lang.js",
19
19
  "clean": "shx rm -rf ./dist ./test/dist ./cjs ./es && shx mkdir -p ./dist ./test/dist ./cjs ./es",
20
20
  "docs": "npm-run-all docs:*",
21
21
  "docs:api": "jsdoc src -r -d docs/api",
22
- "docs:toc": "doctoc --notitle README.md",
22
+ "docs:options": "node scripts/readme-options.js",
23
23
  "lint": "vjsstandard",
24
24
  "server": "karma start scripts/karma.conf.js --singleRun=false --auto-watch",
25
25
  "start": "npm-run-all -p server watch",
@@ -31,7 +31,8 @@
31
31
  "watch": "npm-run-all -p watch:*",
32
32
  "watch:css": "npm run build:css -- -w",
33
33
  "watch:js": "npm run build:js -- -w",
34
- "prepublishOnly": "npm-run-all build-prod && vjsverify --verbose --skip-es-check"
34
+ "prepublishOnly": "npm-run-all build-prod && vjsverify --verbose --skip-es-check",
35
+ "netlify": "node ./scripts/netlify.js"
35
36
  },
36
37
  "engines": {
37
38
  "node": ">=14",
@@ -67,28 +68,37 @@
67
68
  "*.js": "vjsstandard --fix",
68
69
  "README.md": "doctoc --notitle"
69
70
  },
71
+ "dependencies": {
72
+ "global": "^4.4.0"
73
+ },
70
74
  "peerDependencies": {
71
75
  "video.js": "^8"
72
76
  },
73
77
  "devDependencies": {
74
78
  "@babel/runtime": "^7.14.0",
75
79
  "@videojs/generator-helpers": "~3.2.0",
76
- "husky": "^8.0.1",
80
+ "autoprefixer": "^10.4.23",
81
+ "husky": "^9.1.7",
77
82
  "jsdoc": "^4.0.0",
78
83
  "karma": "^6.3.2",
79
84
  "postcss": "^8.2.13",
80
- "postcss-cli": "^8.3.1",
85
+ "postcss-cli": "^11.0.1",
86
+ "postcss-csso": "^6.0.1",
87
+ "postcss-import": "^16.1.1",
88
+ "postcss-nested": "^7.0.2",
89
+ "postcss-progress": "^2.0.0",
81
90
  "rollup": "^2.46.0",
82
- "sinon": "^16.0.0",
91
+ "shelljs": "^0.10.0",
92
+ "sinon": "^21.0.0",
83
93
  "video.js": "^8.0.0",
84
- "videojs-generate-karma-config": "~8.0.0",
85
- "videojs-generate-postcss-config": "~3.0.0",
94
+ "videojs-generate-karma-config": "^8.1.0",
86
95
  "videojs-generate-rollup-config": "^7.0.0",
87
96
  "videojs-generator-verify": "^4.1.0",
88
- "videojs-languages": "^2.0.0",
89
97
  "videojs-standard": "^9.0.1"
90
98
  },
91
- "dependencies": {
92
- "@ungap/global-this": "^0.4.4"
99
+ "overrides": {
100
+ "nomnom": {
101
+ "underscore": "^1.13.0"
102
+ }
93
103
  }
94
104
  }
@@ -0,0 +1,24 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const source = './lang';
5
+ const dest = './dist/lang';
6
+
7
+ if (!fs.existsSync(dest)) {
8
+ fs.mkdirSync(dest);
9
+ }
10
+
11
+ fs.readdirSync(source)
12
+ .filter(file => file.endsWith('.json'))
13
+ .forEach(file => {
14
+ const jsonPath = path.join(source, file);
15
+ const jsonData = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));
16
+ const langName = path.basename(jsonPath, '.json');
17
+ const jsPath = path.join(dest, langName + '.js');
18
+
19
+ const jsContent = `videojs.addLanguage('${langName}', ${
20
+ JSON.stringify(jsonData)
21
+ });\n`;
22
+
23
+ fs.writeFileSync(jsPath, jsContent);
24
+ });
@@ -0,0 +1,16 @@
1
+ const path = require('path');
2
+ const sh = require('shelljs');
3
+ const fs = require('fs');
4
+
5
+ const deployDir = 'deploy';
6
+
7
+ sh.rm('-rf', deployDir);
8
+ sh.mkdir('-p', deployDir);
9
+
10
+ sh.exec('npm run build');
11
+ sh.cp('-r', 'dist', path.join(deployDir, 'dist'));
12
+
13
+ let pluginContent = fs.readFileSync('index.html', 'utf8');
14
+
15
+ pluginContent = pluginContent.replace(/="node_modules\//g, '="https://unpkg.com/');
16
+ fs.writeFileSync(path.join(deployDir, 'index.html'), pluginContent);
@@ -1,9 +1,33 @@
1
- const generate = require('videojs-generate-postcss-config');
2
-
3
1
  module.exports = function(context) {
4
- const result = generate({}, context);
5
-
6
- // do custom stuff here
2
+ const result = {
3
+ plugins: [
4
+ {
5
+ postcssPlugin: 'postcss-progress-start'
6
+ },
7
+ {
8
+ postcssPlugin: 'postcss-import'
9
+ },
10
+ {
11
+ postcssPlugin: 'postcss-nested'
12
+ },
13
+ null,
14
+ null,
15
+ null,
16
+ {
17
+ browsers: [
18
+ 'defaults'
19
+ ],
20
+ options: {},
21
+ postcssPlugin: 'autoprefixer'
22
+ },
23
+ {
24
+ postcssPlugin: 'postcss-csso'
25
+ },
26
+ {
27
+ postcssPlugin: 'postcss-progress-stop'
28
+ }
29
+ ]
30
+ };
7
31
 
8
32
  return result;
9
33
  };