Browse Source

rollup: polish configs

pull/981/head
Vitaly Puzrin 1 year ago
parent
commit
92f21506b8
  1. 5
      package.json
  2. 2
      support/demo_template/rollup.config.mjs
  3. 6
      support/rollup.config.mjs

5
package.json

@ -11,12 +11,12 @@
], ],
"repository": "markdown-it/markdown-it", "repository": "markdown-it/markdown-it",
"license": "MIT", "license": "MIT",
"main": "dist/markdown-it.cjs.js", "main": "dist/index.cjs.js",
"module": "index.mjs", "module": "index.mjs",
"exports": { "exports": {
".": { ".": {
"import": "./index.mjs", "import": "./index.mjs",
"require": "./dist/markdown-it.cjs.js" "require": "./dist/index.cjs.js"
}, },
"./*": { "./*": {
"require": "./*", "require": "./*",
@ -55,7 +55,6 @@
"devDependencies": { "devDependencies": {
"@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-terser": "^0.4.4",
"ansi": "^0.3.0", "ansi": "^0.3.0",

2
support/demo_template/rollup.config.mjs

@ -1,12 +1,10 @@
import nodeResolve from '@rollup/plugin-node-resolve' import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs' import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser' import terser from '@rollup/plugin-terser'
const plugins = [ const plugins = [
nodeResolve({ preferBuiltins: true }), nodeResolve({ preferBuiltins: true }),
commonjs(), commonjs(),
json({ namedExports: false }),
// Here terser is used only to force ascii output // Here terser is used only to force ascii output
terser({ terser({
mangle: false, mangle: false,

6
support/rollup.config.mjs

@ -9,7 +9,7 @@ const config_umd_full = {
input: 'index.mjs', input: 'index.mjs',
output: [ output: [
{ {
file: 'dist/markdown-it.js', file: `dist/${pkg.name}.js`,
format: 'umd', format: 'umd',
name: 'markdownit', name: 'markdownit',
plugins: [ plugins: [
@ -22,7 +22,7 @@ const config_umd_full = {
] ]
}, },
{ {
file: 'dist/markdown-it.min.js', file: `dist/${pkg.name}.min.js`,
format: 'umd', format: 'umd',
name: 'markdownit', name: 'markdownit',
plugins: [ plugins: [
@ -46,7 +46,7 @@ const config_umd_full = {
const config_cjs_no_deps = { const config_cjs_no_deps = {
input: 'index.mjs', input: 'index.mjs',
output: { output: {
file: 'dist/markdown-it.cjs.js', file: 'dist/index.cjs.js',
format: 'cjs' format: 'cjs'
}, },
external: Object.keys(pkg.dependencies), external: Object.keys(pkg.dependencies),

Loading…
Cancel
Save