Skip to content

Commit

Permalink
Merge pull request #16 from clappr/house-keeping
Browse files Browse the repository at this point in the history
House keeping the project dependencies
  • Loading branch information
joaopaulovieira committed Jul 26, 2020
2 parents aff57b7 + 8b7e19b commit 233ba58
Show file tree
Hide file tree
Showing 9 changed files with 5,315 additions and 2,225 deletions.
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"presets": [
["@babel/preset-env", { "modules": false }]
],
"plugins": ["@babel/plugin-proposal-object-rest-spread"],
"env": {
"test": {
"presets": [["@babel/preset-env"]]
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: "10"
node_js: "14"
cache: yarn
os: linux
dist: xenial
Expand Down
49 changes: 23 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,34 @@
},
"homepage": "https://github.com/clappr/clappr-core",
"devDependencies": {
"@babel/core": "^7.8.6",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/preset-env": "^7.8.6",
"@rollup/plugin-alias": "^3.0.1",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-replace": "^2.3.1",
"autoprefixer": "^9.7.4",
"babel-jest": "^25.1.0",
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-babel": "^5.1.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-replace": "^2.3.3",
"autoprefixer": "^9.8.5",
"babel-jest": "^26.1.0",
"clappr-zepto": "0.0.7",
"coveralls": "^3.0.9",
"cz-conventional-changelog": "^3.1.0",
"eslint": "^6.8.0",
"html-loader": "^0.5.5",
"jest": "^25.1.0",
"coveralls": "^3.1.0",
"cz-conventional-changelog": "^3.2.0",
"eslint": "^7.4.0",
"html-loader": "0.5.5",
"jest": "^26.1.0",
"jest-directory-named-resolver": "^0.3.0",
"node-sass": "^4.13.1",
"rollup": "^1.32.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-filesize": "^6.2.1",
"node-sass": "^4.14.1",
"rollup": "^2.22.0",
"rollup-plugin-filesize": "^9.0.2",
"rollup-plugin-html": "^0.2.1",
"rollup-plugin-livereload": "^1.0.4",
"rollup-plugin-livereload": "^1.3.0",
"rollup-plugin-named-directory": "^1.0.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-postcss": "^2.1.1",
"rollup-plugin-serve": "^1.0.1",
"rollup-plugin-postcss": "^3.1.3",
"rollup-plugin-serve": "^1.0.2",
"rollup-plugin-sizes": "^1.0.1",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-visualizer": "^3.3.1"
"rollup-plugin-terser": "^6.1.0",
"rollup-plugin-visualizer": "^4.0.4"
},
"config": {
"commitizen": {
Expand Down
2,652 changes: 2,652 additions & 0 deletions public/stats.html

Large diffs are not rendered by default.

83 changes: 34 additions & 49 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import alias from '@rollup/plugin-alias'
import resolve from '@rollup/plugin-node-resolve'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import replace from '@rollup/plugin-replace'
import jsonReader from '@rollup/plugin-json'
import nodeBuiltins from 'rollup-plugin-node-builtins'
import nodeGlobals from 'rollup-plugin-node-globals'
import namedDirectory from 'rollup-plugin-named-directory'
import replace from '@rollup/plugin-replace'
import resolve from '@rollup/plugin-node-resolve'
import html from 'rollup-plugin-html'
import namedDirectory from 'rollup-plugin-named-directory'
import postcss from 'rollup-plugin-postcss'
import babel from 'rollup-plugin-babel'
import livereload from 'rollup-plugin-livereload'
import serve from 'rollup-plugin-serve'
import filesize from 'rollup-plugin-filesize'
Expand All @@ -30,72 +28,59 @@ const postcssOptions = {
}
const aliasPluginOptions = { entries: { 'clappr-zepto': 'node_modules/clappr-zepto/zepto.js', '@': __dirname + '/src' } }
const replacePluginOptions = { VERSION: JSON.stringify(pkg.version) }
const babelPluginOptions = { exclude: 'node_modules/**' }
const babelPluginOptions = { babelHelpers: 'bundled', exclude: 'node_modules/**' }
const servePluginOptions = { contentBase: ['dist', 'public'], host: '0.0.0.0', port: '8080' }
const livereloadPluginOptions = { watch: ['dist', 'public'] }
const visualizePluginOptions = { open: true }
const terserPluginOptions = { include: [/^.+\.min\.js$/] }
const visualizePluginOptions = { open: true, filename: './public/stats.html' }

const plugins = [
jsonReader(),
alias(aliasPluginOptions),
replace(replacePluginOptions),
resolve(),
commonjs(),
nodeBuiltins(),
nodeGlobals(),
babel(babelPluginOptions),
namedDirectory(),
html(),
postcss(postcssOptions),
size(),
filesize()
filesize(),
dev && serve(servePluginOptions),
dev && livereload(livereloadPluginOptions),
analyzeBundle && visualize(visualizePluginOptions)
]

dev && plugins.push(serve(servePluginOptions), livereload(livereloadPluginOptions))
analyzeBundle && plugins.push(visualize(visualizePluginOptions))

const rollupConfig = [
{
input: 'src/main.js',
output: {
const mainBundle = {
input: 'src/main.js',
output: [
{
exports: 'named',
name: 'Clappr',
file: pkg.main,
format: 'umd',
sourcemap: true,
},
plugins,
},
{
input: 'src/main.js',
output: {
minimize && {
exports: 'named',
name: 'Clappr',
file: pkg.module,
format: 'esm',
},
plugins,
}
]
file: 'dist/clappr-core.min.js',
format: 'iife',
sourcemap: true,
plugins: terser(),
}
],
plugins,
}

minimize && rollupConfig.push(
{
input: 'src/main.js',
output: [
{
exports: 'named',
name: 'Clappr',
file: 'dist/clappr-core.min.js',
format: 'umd',
sourcemap: true,
},
],
plugins: [
...plugins,
terser(terserPluginOptions),
],
}
)
const esmBundle = {
input: 'src/main.js',
output: {
exports: 'named',
name: 'Clappr',
file: pkg.module,
format: 'esm',
},
plugins,
}

export default rollupConfig
export default [mainBundle, esmBundle]
3 changes: 1 addition & 2 deletions src/components/loader/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
import Version from '../../utils/version'
import Log from '../log'
import pkg from '../../../package.json'

const filterPluginsByType = (plugins, type) => {
if (!plugins || !type) return {}
Expand All @@ -27,7 +26,7 @@ export default (() => {
playbacks: []
}

const currentVersion = pkg.version
const currentVersion = VERSION

return class Loader {

Expand Down
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ import Styler from './base/styler'
import template from './base/template'
import Strings from './plugins/strings'
import SourcesPlugin from './plugins/sources'
import pkg from '../package.json'

import $ from 'clappr-zepto'

const version = pkg.version
const version = VERSION

// Built-in Plugins/Playbacks

Expand Down
2 changes: 1 addition & 1 deletion src/playbacks/html5_video/html5_video.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default class HTML5Video extends Playback {
error && Log.warn(this.name, 'autoplay error.', { result, error })

// https://github.com/clappr/clappr/issues/1076
result && process.nextTick(() => !this._destroyed && this.play())
result && setTimeout(() => !this._destroyed && this.play(), 0)
})
}

Expand Down

0 comments on commit 233ba58

Please sign in to comment.