From 054f522aa929061e3a5ff0e15c5e6280e64d846d Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Mon, 14 May 2018 05:03:14 +0200 Subject: [PATCH] Enable importing Plyr in node.js without errors (resulting in an empty object) --- gulpfile.js | 2 ++ package.json | 1 + yarn.lock | 29 ++++++++++++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index eec51abac..262fa2d28 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -13,6 +13,7 @@ const filter = require('gulp-filter'); const sass = require('gulp-sass'); const cleancss = require('gulp-clean-css'); const run = require('run-sequence'); +const header = require('gulp-header'); const prefix = require('gulp-autoprefixer'); const gitbranch = require('git-branch'); const svgstore = require('gulp-svgstore'); @@ -146,6 +147,7 @@ const build = { options, ), ) + .pipe(header('typeof navigator === "object" && ')) // "Support" SSR (#935) .pipe(sourcemaps.write('')) .pipe(gulp.dest(output)) .pipe(filter('**/*.js')) diff --git a/package.json b/package.json index 9ae3bcadd..77bcc78a4 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "gulp-clean-css": "^3.9.4", "gulp-concat": "^2.6.1", "gulp-filter": "^5.1.0", + "gulp-header": "^2.0.5", "gulp-open": "^3.0.1", "gulp-rename": "^1.2.2", "gulp-replace": "^0.6.1", diff --git a/yarn.lock b/yarn.lock index 604dd44da..668865fc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1604,6 +1604,12 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +concat-with-sourcemaps@*: + version "1.1.0" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" + dependencies: + source-map "^0.6.1" + concat-with-sourcemaps@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.5.tgz#8964bc2347d05819b63798104d87d6e001bed8d0" @@ -3024,6 +3030,14 @@ gulp-filter@^5.1.0: plugin-error "^0.1.2" streamfilter "^1.0.5" +gulp-header@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-2.0.5.tgz#16e229c73593ade301168024fea68dab75d9d38c" + dependencies: + concat-with-sourcemaps "*" + lodash.template "^4.4.0" + through2 "^2.0.0" + gulp-open@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/gulp-open/-/gulp-open-3.0.1.tgz#a2f747b4aa31abec9399b527158b0368c57e2102" @@ -4176,7 +4190,7 @@ lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222" -lodash._reinterpolate@^3.0.0: +lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -4342,6 +4356,13 @@ lodash.template@^3.0.0: lodash.restparam "^3.0.0" lodash.templatesettings "^3.0.0" +lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + lodash.templatesettings@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" @@ -4349,6 +4370,12 @@ lodash.templatesettings@^3.0.0: lodash._reinterpolate "^3.0.0" lodash.escape "^3.0.0" +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings@~2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz#ea76c75d11eb86d4dbe89a83893bb861929ac699"