Skip to content

Commit

Permalink
feat(vuetube): remove babel polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
webistomin committed Mar 16, 2021
1 parent 9ab9d8a commit c943c1d
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'prefer-object-spread': 'off',
},
ignorePatterns: ['!.*', 'src/vuetube.d.ts'],
ignorePatterns: ['!.*'],
};
7 changes: 6 additions & 1 deletion build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const BASE_CONFIG = {
'@babel/preset-env',
{
targets: ES_BROWSERSLIST,
exclude: ['@babel/plugin-transform-typeof-symbol'],
},
],
],
Expand Down Expand Up @@ -122,7 +123,11 @@ if (!argv.format || argv.format === 'esm') {
commonjs(),
copy({
targets: [
{ src: 'src/vuetube.d.ts', dest: 'dist/types' },
{
src: 'src/lib.d.ts',
dest: 'dist/types',
rename: (name, extension) => `vuetube.d.${extension}`,
},
],
}),
],
Expand Down
12 changes: 12 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="ru" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="../dist/vuetube.iife.js"></script>
</body>
</html>
12 changes: 8 additions & 4 deletions src/components/VueTube/VueTube.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import {
DEFAULT_HOST, GOOGLE_ADS_URL, GOOGLE_FONTS_URL, GOOGLE_URL, GSTATIC_URL,
DEFAULT_HOST,
GOOGLE_ADS_URL,
GOOGLE_FONTS_URL,
GOOGLE_URL,
GSTATIC_URL,
NO_COOKIES_HOST,
PLAYLIST_VIDEO_SRC,
SINGLE_VIDEO_SRC, YOUTUBE_API_URL, YT3_URL, YTIMG_URL,
Expand All @@ -8,10 +12,10 @@ import { createWarmLink } from '@/helpers/createWarmLink';
import { getStringifiedParams } from '@/helpers/getStringifiedParams';
import { loadYoutubeAPI } from '@/helpers/loadYoutubeAPI';
import { getNormalizeSlot } from '@/helpers/getNormalizedSlot';
import { TImageLoading } from '@/types/image-loading';
import { TThumbnailResolution } from '@/types/thumbnail-resolution';
import { isFunction } from '@/helpers/inspect';
import { TImageLoading } from '@/types/imageLoading';
import { TThumbnailResolution } from '@/types/thumbnailResolution';
import Vue, { PropType, VNode } from 'vue';
import {isFunction} from "@/helpers/inspect";

declare global {
interface Window {
Expand Down
1 change: 1 addition & 0 deletions src/helpers/getNormalizedSlot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types */
import { isFunction } from '@/helpers/inspect';
import { ScopedSlot } from 'vue/types/vnode';
import { PropsDefinition } from 'vue/types/options';
Expand Down
11 changes: 11 additions & 0 deletions src/lib.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { PluginFunction } from 'vue';
import VueTubeComponent from '@/components/VueTube';

declare const VueTubePlugin: PluginFunction<never>;
declare const VueTube: typeof VueTubeComponent;

export {
VueTube,
};

export default VueTubePlugin;
File renamed without changes.
File renamed without changes.
Empty file removed src/vuetube.d.ts
Empty file.
5 changes: 0 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
],
"jsx": "react"
},
"ts-node": {
"compilerOptions": {
"module": "commonjs"
}
},
"exclude": [
"node_modules",
"dist"
Expand Down

0 comments on commit c943c1d

Please sign in to comment.