From 8548a6f898a4cf32fa50ee9c8c1b26e274dc6900 Mon Sep 17 00:00:00 2001 From: Tom Vincent Date: Fri, 22 Jul 2016 13:47:25 +0200 Subject: [PATCH] chore(build): guard against unterminated scripts If ol3 is included as part of a concatenated build and the script before it does not end in a semi-colon, the IIFE is interpreted incorrectly (often resulting in `TypeError: (intermediate value)`). --- tasks/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/build.js b/tasks/build.js index 0fe827e0fb..21595f240d 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -15,7 +15,7 @@ var generateExports = require('./generate-exports'); var log = closure.log; var root = path.join(__dirname, '..'); -var umdWrapper = '(function (root, factory) {\n' + +var umdWrapper = ';(function (root, factory) {\n' + ' if (typeof exports === "object") {\n' + ' module.exports = factory();\n' + ' } else if (typeof define === "function" && define.amd) {\n' +