Skip to content

Commit

Permalink
Upgrade marked to v5 (#74)
Browse files Browse the repository at this point in the history
* bump marked to v5.1.2

* refactor the conditional block in parser.svelte; reuse similar declarations

* completely replace rollup with vite

* add terser, analyze and filesize

* revert changes made in parser.svelte
  • Loading branch information
nwaughachukwuma authored Aug 29, 2023
1 parent fed4f0a commit dfe2cc9
Show file tree
Hide file tree
Showing 4 changed files with 1,067 additions and 321 deletions.
16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,31 @@
"repository": "github:pablo-abc/svelte-markdown",
"homepage": "https://github.com/pablo-abc/svelte-markdown",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"build": "vite build",
"dev": "vite build --watch",
"test": "vitest run",
"test:watch": "vitest watch"
},
"devDependencies": {
"@rollup/plugin-commonjs": "17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^4.0.3",
"eslint": "^7.20.0",
"eslint-plugin-svelte": "^2.32.2",
"jsdom": "^22.1.0",
"prettier": "^2.2.1",
"rollup": "^2.39.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-svelte": "^7.1.6",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-terser": "^7.0.2",
"sirv-cli": "^1.0.11",
"svelte": "^4.0.5",
"svelte-eslint-parser": "^0.32.1",
"vite": "^4.4.4",
"vite": "^4.4.7",
"vitest": "^0.33.0"
},
"dependencies": {
"@types/marked": "^4.0.1",
"marked": "^4.0.10"
"@types/marked": "^5.0.1",
"marked": "^5.1.2"
},
"peerDependencies": {
"svelte": "^4.0.0"
Expand Down
47 changes: 0 additions & 47 deletions rollup.config.js

This file was deleted.

28 changes: 28 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import analyze from 'rollup-plugin-analyzer'
import { terser } from 'rollup-plugin-terser'
import filesize from 'rollup-plugin-filesize'
import pkg from './package.json'

const production = !process.argv.includes('--watch')
const removeDist = (p) => p.replace('dist/', '')

export default defineConfig({
plugins: [svelte({ hot: !process.env.VITEST })],
test: {
globals: true,
environment: 'jsdom',
},
build: {
rollupOptions: {
input: 'src/index.js',
plugins: [
production && terser(),
production && analyze(),
production && filesize(),
],
},
sourcemap: true,
lib: {
entry: new URL('src/index.js', import.meta.url).pathname,
formats: ['es', 'umd'],
name: pkg.name,
fileName: (format) =>
({
es: removeDist(pkg.module),
umd: removeDist(pkg.main),
}[format]),
},
},
})
Loading

0 comments on commit dfe2cc9

Please sign in to comment.