liferay-npm-bundler-plugin-replace-browser-modules
Advanced tools
Comparing version 2.6.2 to 2.7.0
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* index function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* test2 function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testBrowser2 function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testBrowser function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testMain function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -8,2 +8,8 @@ 'use strict'; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* test function | ||
@@ -10,0 +16,0 @@ * @return {void} |
@@ -24,2 +24,8 @@ 'use strict'; | ||
// Package descriptor used in tests | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
var pkg = { | ||
@@ -117,3 +123,3 @@ id: 'package@1.0.0', | ||
browser: { | ||
'dir': 'test-main.js', | ||
dir: 'test-main.js', | ||
'test-browser.js': 'test.js', | ||
@@ -120,0 +126,0 @@ 'test-browser-2.js': 'test-2.js' |
@@ -8,4 +8,4 @@ 'use strict'; | ||
exports.default = function (_ref, _ref2) { | ||
var pkg = _ref.pkg, | ||
log = _ref.log; | ||
var log = _ref.log, | ||
pkg = _ref.pkg; | ||
var pkgJson = _ref2.pkgJson; | ||
@@ -15,8 +15,6 @@ | ||
if (browser) { | ||
if (typeof browser === 'string') { | ||
replaceMainModule(pkg.dir, browser, pkgJson, log); | ||
} else { | ||
replaceModules(pkg.dir, browser, pkgJson, log); | ||
} | ||
if (typeof browser === 'string') { | ||
replaceMainModule(pkg.dir, browser, pkgJson, log); | ||
} else if (browser) { | ||
replaceModules(pkg.dir, browser, pkgJson, log); | ||
} else { | ||
@@ -51,2 +49,8 @@ log.info('replace-browser-modules', 'No browser modules found'); | ||
*/ | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
function replaceMainModule(pkgDir, browser, pkgJson, log) { | ||
@@ -65,3 +69,3 @@ var pkgId = pkgJson.name + '@' + pkgJson.version; | ||
* @param {String} pkgDir directory where package is placed | ||
* @param {String} browser the value of the "browser"/"module" field | ||
* @param {Object} browser the value of the "browser"/"module" field | ||
* @param {Object} pkgJson package.json contents | ||
@@ -68,0 +72,0 @@ * @param {PluginLogger} log a logger |
{ | ||
"name": "liferay-npm-bundler-plugin-replace-browser-modules", | ||
"version": "2.6.2", | ||
"version": "2.7.0", | ||
"description": "A liferay-npm-bundler plugin to replace files listed under the browser/module entry of package.json files.", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"fs-extra": "^7.0.1", | ||
"liferay-npm-build-tools-common": "2.6.2" | ||
"liferay-npm-build-tools-common": "2.7.0" | ||
} | ||
} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* index function | ||
@@ -3,0 +9,0 @@ * @return {void} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* test2 function | ||
@@ -3,0 +9,0 @@ * @return {void} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testBrowser2 function | ||
@@ -3,0 +9,0 @@ * @return {void} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testBrowser function | ||
@@ -3,0 +9,0 @@ * @return {void} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* testMain function | ||
@@ -3,0 +9,0 @@ * @return {void} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
/** | ||
* test function | ||
@@ -3,0 +9,0 @@ * @return {void} |
@@ -0,1 +1,7 @@ | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
import * as fs from 'fs-extra'; | ||
@@ -107,3 +113,3 @@ import PluginLogger from 'liferay-npm-build-tools-common/lib/plugin-logger'; | ||
browser: { | ||
'dir': 'test-main.js', | ||
dir: 'test-main.js', | ||
'test-browser.js': 'test.js', | ||
@@ -110,0 +116,0 @@ 'test-browser-2.js': 'test-2.js', |
@@ -0,1 +1,7 @@ | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
import fs from 'fs-extra'; | ||
@@ -8,11 +14,9 @@ import * as pkgs from 'liferay-npm-build-tools-common/lib/packages'; | ||
*/ | ||
export default function({pkg, log}, {pkgJson}) { | ||
export default function({log, pkg}, {pkgJson}) { | ||
const browser = pkgJson.browser || pkgJson.unpkg || pkgJson.jsdelivr; | ||
if (browser) { | ||
if (typeof browser === 'string') { | ||
replaceMainModule(pkg.dir, browser, pkgJson, log); | ||
} else { | ||
replaceModules(pkg.dir, browser, pkgJson, log); | ||
} | ||
if (typeof browser === 'string') { | ||
replaceMainModule(pkg.dir, browser, pkgJson, log); | ||
} else if (browser) { | ||
replaceModules(pkg.dir, browser, pkgJson, log); | ||
} else { | ||
@@ -44,3 +48,3 @@ log.info('replace-browser-modules', 'No browser modules found'); | ||
* @param {String} pkgDir directory where package is placed | ||
* @param {String} browser the value of the "browser"/"module" field | ||
* @param {Object} browser the value of the "browser"/"module" field | ||
* @param {Object} pkgJson package.json contents | ||
@@ -47,0 +51,0 @@ * @param {PluginLogger} log a logger |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
49570
712
2
70
+ Addedliferay-npm-build-tools-common@2.7.0(transitive)
- Removedliferay-npm-build-tools-common@2.6.2(transitive)