From 28566475a5f9b3d77fd9acf55ff63aad420bea70 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Fri, 29 May 2015 22:33:46 -0400 Subject: [PATCH] check for moduleName option when exporting from UMD bundle --- src/finalisers/umd.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/finalisers/umd.js b/src/finalisers/umd.js index 490b60c..fa69822 100644 --- a/src/finalisers/umd.js +++ b/src/finalisers/umd.js @@ -2,6 +2,10 @@ import { has } from '../utils/object'; import { getName, quoteId, req } from '../utils/map-helpers'; export default function umd ( bundle, magicString, exportMode, options ) { + if ( exportMode !== 'none' && !options.moduleName ) { + throw new Error( 'You must supply options.moduleName for UMD bundles' ); + } + const indentStr = magicString.getIndentString(); const globalNames = options.globals || {};