From 68046d4445529db1e19c5c46a18e408c04bdbd4d Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 02:17:25 +0400 Subject: [PATCH] fix removeLicenceComments breaking packaged file --- node_modules/architect-build/module-deps.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node_modules/architect-build/module-deps.js b/node_modules/architect-build/module-deps.js index 083429bd..daae178c 100644 --- a/node_modules/architect-build/module-deps.js +++ b/node_modules/architect-build/module-deps.js @@ -346,8 +346,11 @@ function removeUseStrict(module) { } function removeLicenceComments(module) { - if (/\.(js|jsx|css|less)/.test(module.path)) - module.source = module.source.replace(/(?:(;)|\n|^)\s*\/\*[\d\D]*?\*\/|(\n|^)\s*\/\/.*/g, "$1"); + if (/\.(js|jsx|css|less)/.test(module.path)) { + module.source = module.source.replace(/(\n|;|^|,)(?:[ \t]*(?:\/\*(?:[^*]|[*](?![/]))*?\*\/|\/\/.*\n))+(\n?)/gm, function(match, $1, $2) { + return $1 == $2 ? $1 : $1 + $2; + }); + } } function removeLicenceCommentsKeepLines(module) { if (/\.(js|jsx|css|less)/.test(module.path)) {