From 03f418dc8d7aa45fffb2a627caf0b3b93b56b4b0 Mon Sep 17 00:00:00 2001 From: Jungho Bang Date: Fri, 8 Dec 2023 12:31:18 -0500 Subject: [PATCH] Optimize compile-assets.js (#1094) * remove copyright * optimize compile asset --- packages/wallet-sdk/compile-assets.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/wallet-sdk/compile-assets.js b/packages/wallet-sdk/compile-assets.js index c67709445b..2622c52ef4 100644 --- a/packages/wallet-sdk/compile-assets.js +++ b/packages/wallet-sdk/compile-assets.js @@ -7,18 +7,13 @@ const glob = require('glob'); const sass = require('sass'); const { optimize } = require('svgo'); -const COPYRIGHT = ` - // Copyright (c) 2018-2023 Coinbase, Inc. - // Licensed under the Apache License, version 2.0 -`; - async function main() { // compile SCSS const scssFiles = glob.sync(`${__dirname}/src/**/*.scss`); for (const filePath of scssFiles) { console.info(`Compiling ${filePath}...`); const css = sass.renderSync({ file: filePath, outputStyle: 'compressed' }).css.toString('utf8'); - const ts = `${COPYRIGHT}\n\nexport default \`${css}\``; + const ts = `export default (() => \`${css}\`)();`; fs.writeFileSync(filePath.replace(/\.scss$/, '-css.ts'), ts, { mode: 0o644, }); @@ -36,7 +31,7 @@ async function main() { // so we enable multipass for that to happen multipass: true, }); - const ts = `${COPYRIGHT}\n\nexport default \`${data}\``; + const ts = `export default \`${data}\``; fs.writeFileSync(filePath.replace(/\.svg$/, '-svg.ts'), ts, { mode: 0o644, });