From 2a44f7acc1935475f04f1d55944196b8b4349631 Mon Sep 17 00:00:00 2001 From: Nick Frasser Date: Wed, 13 Oct 2021 21:45:38 -0400 Subject: [PATCH] Export plugins and interfaces as .module.js Not sure how to configure these to work in the browser given that they rely on the 'linkifyjs' module which doesn't really resolve neatly. Gonna leave it as is until someone complains --- rollup.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 9bcd67b1..90100599 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,6 +25,7 @@ export function linkifyInterface(name, opts = {}) { { file: 'index.js', format: 'cjs', exports: 'auto' }, { file: `dist/linkify-${name}.js`, format: 'iife', globals, ...iifeOpts }, { file: `dist/linkify-${name}.min.js`, format: 'iife', globals, ...iifeOpts, plugins: [terser()] }, + { file: `dist/linkify-${name}.module.js`, format: 'es' }, ], plugins }; @@ -41,6 +42,7 @@ export function linkifyClassicInterface(name, opts = {}) { const output = [ { file: `dist/linkify-${name}.js`, format: 'iife', globals, ...iifeOpts }, { file: `dist/linkify-${name}.min.js`, format: 'iife', globals, ...iifeOpts, plugins: [terser()] }, + { file: `dist/linkify-${name}.module.js`, format: 'es' } ]; if (opts.commonjs) { output.push({ file: `lib/linkify-${name}.js`, format: 'cjs', exports: 'auto' }); @@ -61,7 +63,8 @@ export function linkifyPlugin(name, opts = {}) { const globals = { linkifyjs: 'linkify' }; const output = [ { file: `dist/linkify-plugin-${name}.js`, format: 'iife', globals, name: false }, - { file: `dist/linkify-plugin-${name}.min.js`, format: 'iife', globals, name: false, plugins: [terser()] } + { file: `dist/linkify-plugin-${name}.min.js`, format: 'iife', globals, name: false, plugins: [terser()] }, + { file: `dist/linkify-plugin-${name}.module.js`, format: 'es' } ]; if (opts.commonjs) { output.push({ file: `lib/plugins/${name}.js`, format: 'cjs', exports: 'auto' });