Skip to content

Commit

Permalink
Merge pull request #15 from marp-team/stop-bundle-dependencies-module
Browse files Browse the repository at this point in the history
Reduce bundle size by stopping to resolve dependencies
  • Loading branch information
yhatt authored Aug 11, 2018
2 parents 402ef11 + 6111ad2 commit 4ba9086
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Reduce bundle size by stopping to resolve dependencies ([#15](https://github.com/marp-team/marp-core/pull/15))

## v0.0.1 - 2018-08-10

- Initial release.
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import pkg from './package.json'

export default [
{
external: ['@marp-team/marpit', 'postcss'],
external: Object.keys(pkg.dependencies),
input: `src/${path.basename(pkg.main, '.js')}.ts`,
output: {
file: pkg.main,
Expand Down
8 changes: 4 additions & 4 deletions src/marp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable: import-name */
import { Marpit, MarpitOptions, ThemeSetPackOptions } from '@marp-team/marpit'
import highlightjs from 'highlight.js'
import katexPackage from 'katex/package.json'
import { version } from 'katex/package.json'
import markdownItEmoji from 'markdown-it-emoji'
import { markdownItPlugin as mathMD, css as mathCSS } from './markdown/math'
import defaultTheme from '../themes/default.scss'
Expand Down Expand Up @@ -84,9 +84,9 @@ export class Marp extends Marpit {

if (math && this.renderedMath) {
// By default, we use KaTeX web fonts through CDN.
let path: string | undefined = `https://cdn.jsdelivr.net/npm/katex@${
katexPackage.version
}/dist/fonts/`
let path:
| string
| undefined = `https://cdn.jsdelivr.net/npm/katex@${version}/dist/fonts/`

if (typeof math === 'object') {
path = math.katexFontPath === false ? undefined : math.katexFontPath
Expand Down
4 changes: 0 additions & 4 deletions src/scss.d.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module '*.scss' {
const scss: string
export default scss
}

declare module 'katex/package.json' {
export const version: string
}

0 comments on commit 4ba9086

Please sign in to comment.