From 2202aff184070bd7900168fe9ad889a5dc78ad22 Mon Sep 17 00:00:00 2001 From: Frieder Griesshammer Date: Fri, 14 May 2021 19:16:37 +0200 Subject: Drop pointless function definitions and calls from rollup config --- CHANGELOG.md | 3 +- rollup.config.js | 120 +++++++++++++++++++++++++++---------------------------- 2 files changed, 60 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff296e..2b3ecc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ and this project adheres to ``source-sans`` and ``source-serif`` (got renamed). ### Fixed -- Display of line numbers in inline code blocks +- Display of line numbers in inline code blocks. +- Some cruft inside `rollup.config.js`. ## [v0.3.3] diff --git a/rollup.config.js b/rollup.config.js index 08c8280..bf5dabb 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -26,73 +26,69 @@ const STATIC = path.normalize(path.join( __dirname, 'static', )); -const assetStyle = () => { - return { - input: path.join(SOURCES, '_style.css'), - output: { - file: path.join(ASSETS, 'style.css'), - format: 'system', - }, - plugins: [ - postcss({ - plugins: [ - cssimport(), - cssurl({ - url: 'copy', - assetsPath: path.join(STATIC, 'assets', 'fonts'), - useHash: true, - }), - cssurl({ - url: (asset) => path.relative( - STATIC, path.join(NODE_M, asset.url) - ), - }), - cssprefixer(), - cssdiscard({ - removeAll: true, - }), - ], - extract: true, - minimize: !DEVELOP, - sourceMap: (DEVELOP ? 'inline' : false), - }), - copier({ - items: [{ - src: path.join(NODE_M, 'purecss', 'LICENSE'), - dest: path.join(STATIC, 'assets', 'license-purecss'), - }, { - src: path.join(NODE_M, 'source-code-pro', 'LICENSE.md'), - dest: path.join(STATIC, 'assets', 'license-source-code-pro.md'), - }, { - src: path.join(NODE_M, 'source-sans', 'LICENSE.md'), - dest: path.join(STATIC, 'assets', 'license-source-sans-pro.md'), - }, { - src: path.join(NODE_M, 'source-serif', 'LICENSE.md'), - dest: path.join(STATIC, 'assets', 'license-source-serif-pro.md'), - }], - }), - ], - }; +const assetStyle = { + input: path.join(SOURCES, '_style.css'), + output: { + file: path.join(ASSETS, 'style.css'), + format: 'system', + }, + plugins: [ + postcss({ + plugins: [ + cssimport(), + cssurl({ + url: 'copy', + assetsPath: path.join(STATIC, 'assets', 'fonts'), + useHash: true, + }), + cssurl({ + url: (asset) => path.relative( + STATIC, path.join(NODE_M, asset.url) + ), + }), + cssprefixer(), + cssdiscard({ + removeAll: true, + }), + ], + extract: true, + minimize: !DEVELOP, + sourceMap: (DEVELOP ? 'inline' : false), + }), + copier({ + items: [{ + src: path.join(NODE_M, 'purecss', 'LICENSE'), + dest: path.join(STATIC, 'assets', 'license-purecss'), + }, { + src: path.join(NODE_M, 'source-code-pro', 'LICENSE.md'), + dest: path.join(STATIC, 'assets', 'license-source-code-pro.md'), + }, { + src: path.join(NODE_M, 'source-sans', 'LICENSE.md'), + dest: path.join(STATIC, 'assets', 'license-source-sans-pro.md'), + }, { + src: path.join(NODE_M, 'source-serif', 'LICENSE.md'), + dest: path.join(STATIC, 'assets', 'license-source-serif-pro.md'), + }], + }), + ], }; -const assetScript = () => { - return { - input: path.join(SOURCES, '_script.ts'), - output: { - file: path.join(ASSETS, 'script.js'), - format: 'iife', - sourcemap: DEVELOP, - }, - plugins: [ - typescript(), - (DEVELOP ? null : terser()), - ], - }; +const assetScript = { + input: path.join(SOURCES, '_script.ts'), + output: { + file: path.join(ASSETS, 'script.js'), + format: 'iife', + sourcemap: DEVELOP, + }, + plugins: [ + typescript(), + (DEVELOP ? null : terser()), + ], }; export default [ - assetStyle(), - assetScript(), + assetStyle, + assetScript, ]; -- cgit v1.2.3