From b3a867d7ffb668384118ac482709e1e0761d3980 Mon Sep 17 00:00:00 2001 From: Marcel Panse Date: Fri, 11 May 2018 15:21:57 +0200 Subject: [PATCH 1/2] Add option to not include the Data API initialization code --- build-module-v4.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-module-v4.js b/build-module-v4.js index eca44fc7..86198b64 100644 --- a/build-module-v4.js +++ b/build-module-v4.js @@ -86,7 +86,7 @@ module.exports = (options) => { function wrap(main) { var utils = fs.readFileSync(`${libPath}/V4/utils.js`, 'utf8').split('\n').join('\n '); - var init = fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n '); + var init = options.noInitDataAPI ? '' : fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n '); main = main.split('\n').join('\n '); // Initialize arrays: // Arrays will be used in the template literal below From edb6203d60500d74681449098e5dd7de80ba4024 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 11 May 2018 21:24:02 +0200 Subject: [PATCH 2/2] renamed option to 'autoInitDataAPI' and set default to true --- build-module-v4.js | 2 +- build-module.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-module-v4.js b/build-module-v4.js index 86198b64..97921208 100644 --- a/build-module-v4.js +++ b/build-module-v4.js @@ -86,7 +86,7 @@ module.exports = (options) => { function wrap(main) { var utils = fs.readFileSync(`${libPath}/V4/utils.js`, 'utf8').split('\n').join('\n '); - var init = options.noInitDataAPI ? '' : fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n '); + var init = options.autoInitDataAPI === false ? '' : options.noInitDataAPI ? '' : fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n '); main = main.split('\n').join('\n '); // Initialize arrays: // Arrays will be used in the template literal below diff --git a/build-module.js b/build-module.js index bc538a4d..b730c67b 100644 --- a/build-module.js +++ b/build-module.js @@ -86,7 +86,7 @@ module.exports = (options) => { function wrap(main) { var utils = fs.readFileSync(`${libPath}/V3/utils.js`, 'utf8').split('\n').join('\n '); - var init = fs.readFileSync(`${libPath}/V3/utils-init.js`, 'utf8').split('\n').join('\n '); + var init = options.autoInitDataAPI === false ? '' : fs.readFileSync(`${libPath}/V3/utils-init.js`, 'utf8').split('\n').join('\n '); main = main.split('\n').join('\n '); // Initialize arrays: // Arrays will be used in the template literal below