Skip to content

Commit

Permalink
Export plugins and interfaces as .module.js
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nick Frasser committed Oct 14, 2021
1 parent 5e702da commit 2a44f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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' });
Expand All @@ -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' });
Expand Down

0 comments on commit 2a44f7a

Please sign in to comment.