.esm suffix for module bundle, marked/highlight.js are installed via npm

This commit is contained in:
Hakim El Hattab 2020-05-04 10:39:37 +02:00
parent a4cb3307bb
commit 60cd098c8d
42 changed files with 270 additions and 2154 deletions

View File

@ -412,12 +412,12 @@ Reveal.on( 'customevent', function() {
<script type="module">
import Reveal from '/dist/reveal.js';
import Zoom from '/plugin/zoom/zoom.js';
import Notes from '/plugin/notes/notes.js';
import Search from '/plugin/search/search.js';
import Markdown from '/plugin/markdown/markdown.js';
import Highlight from '/plugin/highlight/highlight.js';
import Reveal from '/dist/reveal.esm.js';
import Zoom from '/dist/plugin/zoom.esm.js';
import Notes from '/dist/plugin/notes.esm.js';
import Search from '/dist/plugin/search.esm.js';
import Markdown from '/dist/plugin/markdown.esm.js';
import Highlight from '/dist/plugin/highlight.esm.js';
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({

5
dist/plugin/highlight.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/plugin/markdown.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/plugin/math.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/plugin/notes.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

7
dist/plugin/search.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

4
dist/plugin/zoom.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

30
dist/reset.css vendored
View File

@ -1,30 +0,0 @@
/* http://meyerweb.com/eric/tools/css/reset/
v4.0 | 20180602
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section {
display: block;
}

4
dist/reveal.css vendored

File diff suppressed because one or more lines are too long

9
dist/reveal.es5.js vendored

File diff suppressed because one or more lines are too long

9
dist/reveal.esm.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,8 @@ const qunit = require('node-qunit-puppeteer')
const {rollup} = require('rollup')
const {terser} = require('rollup-plugin-terser')
const babel = require('rollup-plugin-babel')
const commonjs = require('@rollup/plugin-commonjs')
const resolve = require('@rollup/plugin-node-resolve')
const gulp = require('gulp')
const tap = require('gulp-tap')
@ -47,6 +49,8 @@ const rollupConfig = {
}
]]
}),
resolve(),
commonjs(),
terser()
]
};
@ -57,7 +61,7 @@ gulp.task('js', () => {
...rollupConfig
}).then( bundle => {
bundle.write({
file: './dist/reveal.js',
file: './dist/reveal.esm.js',
format: 'es',
banner: banner,
sourcemap: true
@ -65,7 +69,7 @@ gulp.task('js', () => {
bundle.write({
name: 'Reveal',
file: './dist/reveal.es5.js',
file: './dist/reveal.js',
format: 'umd',
banner: banner,
sourcemap: true
@ -75,19 +79,25 @@ gulp.task('js', () => {
gulp.task('plugins', () => {
return Promise.all([
{ name: 'RevealHighlight', input: './plugin/highlight/highlight.js', output: './dist/plugin/highlight.js' },
{ name: 'RevealMarkdown', input: './plugin/markdown/markdown.js', output: './dist/plugin/markdown.js' },
{ name: 'RevealSearch', input: './plugin/search/search.js', output: './dist/plugin/search.js' },
{ name: 'RevealNotes', input: './plugin/notes/notes.js', output: './dist/plugin/notes.js' },
{ name: 'RevealZoom', input: './plugin/zoom/zoom.js', output: './dist/plugin/zoom.js' },
{ name: 'RevealMath', input: './plugin/math/math.js', output: './dist/plugin/math.js' }
{ name: 'RevealHighlight', input: './plugin/highlight/plugin.js', output: './dist/plugin/highlight' },
{ name: 'RevealMarkdown', input: './plugin/markdown/plugin.js', output: './dist/plugin/markdown' },
{ name: 'RevealSearch', input: './plugin/search/plugin.js', output: './dist/plugin/search' },
{ name: 'RevealNotes', input: './plugin/notes/plugin.js', output: './dist/plugin/notes' },
{ name: 'RevealZoom', input: './plugin/zoom/plugin.js', output: './dist/plugin/zoom' },
{ name: 'RevealMath', input: './plugin/math/plugin.js', output: './dist/plugin/math' },
].map( plugin => {
return rollup({
input: plugin.input,
...rollupConfig
}).then( bundle => {
return bundle.write({
file: plugin.output,
bundle.write({
file: plugin.output + '.esm.js',
name: plugin.name,
format: 'es'
})
bundle.write({
file: plugin.output + '.js',
name: plugin.name,
format: 'umd'
})

View File

@ -21,7 +21,7 @@
</div>
</div>
<script src="dist/reveal.es5.js"></script>
<script src="dist/reveal.js"></script>
<script src="dist/plugin/markdown.js"></script>
<script src="dist/plugin/highlight.js"></script>
<script src="dist/plugin/notes.js"></script>

171
package-lock.json generated
View File

@ -908,18 +908,123 @@
"to-fast-properties": "^2.0.0"
}
},
"@rollup/plugin-commonjs": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz",
"integrity": "sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.0.8",
"commondir": "^1.0.1",
"estree-walker": "^1.0.1",
"glob": "^7.1.2",
"is-reference": "^1.1.2",
"magic-string": "^0.25.2",
"resolve": "^1.11.0"
}
},
"@rollup/plugin-node-resolve": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz",
"integrity": "sha512-RxtSL3XmdTAE2byxekYLnx+98kEUOrPHF/KRVjLH+DEIHy6kjIw7YINQzn+NXiH/NTrQLAwYs0GWB+csWygA9Q==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.0.8",
"@types/resolve": "0.0.8",
"builtin-modules": "^3.1.0",
"is-module": "^1.0.0",
"resolve": "^1.14.2"
}
},
"@rollup/pluginutils": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.9.tgz",
"integrity": "sha512-TLZavlfPAZYI7v33wQh4mTP6zojne14yok3DNSLcjoG/Hirxfkonn6icP5rrNWRn8nZsirJBFFpijVOJzkUHDg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"micromatch": "^4.0.2"
},
"dependencies": {
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
}
}
},
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
},
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
},
"@types/mime-types": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz",
"integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=",
"dev": true
},
"@types/node": {
"version": "13.13.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz",
"integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==",
"dev": true
},
"@types/resolve": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz",
"integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@ -1519,6 +1624,12 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"builtin-modules": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz",
"integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==",
"dev": true
},
"bytes": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz",
@ -1793,6 +1904,12 @@
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
},
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"component-emitter": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
@ -2415,6 +2532,12 @@
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"dev": true
},
"estree-walker": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
"dev": true
},
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
@ -3994,6 +4117,12 @@
}
}
},
"highlight.js": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.0.1.tgz",
"integrity": "sha512-l1HB5S9nmBuvurFIOPbpeJv4psKh2MyKCTOYRK/E6dwRXkbG96PLH7amP/xpGNyZOK8OWqv45DxLS/ZAIb3n9w==",
"dev": true
},
"homedir-polyfill": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@ -4368,6 +4497,12 @@
"is-extglob": "^2.1.1"
}
},
"is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
"dev": true
},
"is-negated-glob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
@ -4403,6 +4538,15 @@
"isobject": "^3.0.1"
}
},
"is-reference": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz",
"integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==",
"dev": true,
"requires": {
"@types/estree": "0.0.39"
}
},
"is-relative": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
@ -4754,6 +4898,15 @@
"yallist": "^2.1.2"
}
},
"magic-string": {
"version": "0.25.7",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
"dev": true,
"requires": {
"sourcemap-codec": "^1.4.4"
}
},
"make-iterator": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
@ -4790,6 +4943,12 @@
"object-visit": "^1.0.0"
}
},
"marked": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz",
"integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==",
"dev": true
},
"matchdep": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
@ -5527,6 +5686,12 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
@ -6701,6 +6866,12 @@
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
"dev": true
},
"sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"dev": true
},
"sparkles": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",

View File

@ -4,7 +4,8 @@
"description": "The HTML Presentation Framework",
"homepage": "https://revealjs.com",
"subdomain": "revealjs",
"main": "js/reveal.js",
"main": "dist/reveal.js",
"module": "dist/reveal.esm.js",
"license": "MIT",
"scripts": {
"test": "gulp test",
@ -23,9 +24,16 @@
"engines": {
"node": ">=10.0.0"
},
"keywords": [
"reveal",
"slides",
"presentation"
],
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"babel-eslint": "^10.1.0",
"colors": "^1.4.0",
"core-js": "^3.6.5",
@ -46,6 +54,10 @@
"rollup-plugin-terser": "^5.3.0",
"yargs": "^15.1.0"
},
"dependencies": {
"highlight.js": "^10.0.1",
"marked": "^1.0.0"
},
"browserslist": "> 0.5%, IE 11, not dead",
"eslintConfig": {
"env": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import hljs from './highlight-core.js'
import hljs from 'highlight.js'
import './highlight-line-numbers.js'
/*!

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
* of external markdown documents.
*/
import marked from './marked.js'
import marked from 'marked'
const DEFAULT_SLIDE_SEPARATOR = '^\r?\n---\r?\n$',
DEFAULT_NOTES_SEPARATOR = 'notes?:',

View File

@ -62,7 +62,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
QUnit.config.reorder = false;

View File

@ -26,7 +26,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
var externalScriptSequence = '';
var scriptCount = 0;

View File

@ -26,7 +26,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
window.externalScriptSequence = '';

View File

@ -38,7 +38,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize().then( () => {

View File

@ -31,7 +31,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize({ viewDistance: 3 }).then( () => {

View File

@ -31,7 +31,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize({ viewDistance: 2 }).then( () => {

View File

@ -285,9 +285,9 @@
</div>
<script type="module">
import Reveal from '../js/reveal.js'
import Markdown from '../plugin/markdown/markdown.js'
import Highlight from '../plugin/highlight/highlight.js'
import Reveal from '../dist/reveal.esm.js'
import Markdown from '../dist/plugin/markdown.esm.js'
import Highlight from '../dist/plugin/highlight.esm.js'
let deck1 = new Reveal( document.querySelector( '.deck1' ), { plugins: [ Markdown ] })
deck1.addEventListener( 'ready', function() {

View File

@ -36,7 +36,7 @@
</div>
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script src="../dist/plugin/zoom.js"></script>
<script>

View File

@ -38,15 +38,15 @@
<script type="module">
import Reveal from '../dist/reveal.js';
import zoom from '../plugin/zoom/zoom.js';
import Reveal from '../dist/reveal.esm.js';
import Zoom from '../dist/plugin/zoom.esm.js';
QUnit.module( 'Multiple reveal.js instances' );
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), {
embedded: true,
keyboard: true,
plugins: [zoom()]
plugins: [ Zoom ]
} );
r1.initialize();

View File

@ -73,7 +73,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize({ pdf: true }).then( function() {

View File

@ -26,7 +26,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
QUnit.module( 'Plugins' );

View File

@ -36,7 +36,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
Reveal.initialize().then( function() {

View File

@ -77,7 +77,7 @@
</div>
<script src="../dist/reveal.es5.js"></script>
<script src="../dist/reveal.js"></script>
<script>
window.location.hash = '';