From 7626cc01b3a7c3c21d632b1a55d68b7c160bcce3 Mon Sep 17 00:00:00 2001 From: aab-odoo Date: Thu, 22 Oct 2020 13:58:10 +0200 Subject: [PATCH] [IMP] rollup: properly indent generated files (#774) Also lint rollup.config.js --- rollup.config.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 40499abb..c5071d91 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,26 +3,26 @@ import git from "git-rev-sync"; import typescript from 'rollup-plugin-typescript2'; import { terser } from "rollup-plugin-terser"; -const name = "owl" -const extend = true +const name = "owl"; +const extend = true; /** - * Meta data to be added on the __info__ object. + * Meta data to be added on the __info__ object. * Used to let external tools know the current owl version. */ -const outro = ` +const outro = ` __info__.version = '${pkg.version}'; __info__.date = '${new Date().toISOString()}'; __info__.hash = '${git.short()}'; __info__.url = 'https://github.com/odoo/owl'; -` +`; /** * Generate from a string depicting a path a new path for the minified version. - * @param {string} pkgFileName file name + * @param {string} pkgFileName file name */ function generateMinifiedNameFromPkgName(pkgFileName) { - const parts = pkgFileName.split('.') + const parts = pkgFileName.split('.'); parts.splice(parts.length - 1, 0, "min"); return parts.join('.'); } @@ -40,8 +40,9 @@ function getConfigForFormat(format, generatedFileName, minified = false) { name: name, extend: extend, outro: outro, - plugins: minified ? [terser()] : [] - } + plugins: minified ? [terser()] : [], + indent: ' ', // indent with 4 spaces + }; } export default {