From 3894c64889f7aa25303adcecdff7c94c84ccd857 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 6 Apr 2017 15:34:38 -0700 Subject: [PATCH] Configure dist output to use UMD format (#1090) --- gulpfile.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 322195fa96..5ddc4da5b9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -76,13 +76,28 @@ var buildDist = function(opts) { var webpackOpts = { debug: opts.debug, externals: { - immutable: 'Immutable', - react: 'React', - 'react-dom': 'ReactDOM', + immutable: { + root: 'Immutable', + commonjs2: 'immutable', + commonjs: 'immutable', + amd: 'immutable', + }, + react: { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react', + }, + 'react-dom': { + root: 'ReactDOM', + commonjs2: 'react-dom', + commonjs: 'react-dom', + amd: 'react-dom', + }, }, output: { filename: opts.output, - libraryTarget: 'var', + libraryTarget: 'umd', library: 'Draft', }, plugins: [