From 4a304b7afc698a2c10958ef867e9c2bb4ecbafb8 Mon Sep 17 00:00:00 2001 From: Anthony Gubler Date: Sun, 22 Mar 2020 13:05:10 +0000 Subject: [PATCH] Revert "remove variables support (#30)" This reverts commit b74241976405a30963194e7b076fe09621d5d6a3. --- src/webpack.config.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/webpack.config.ts b/src/webpack.config.ts index 5048208..804d9f8 100644 --- a/src/webpack.config.ts +++ b/src/webpack.config.ts @@ -21,6 +21,9 @@ export default function webpackConfigFactory(args: any): Configuration { const themesPath = args.themePath ? path.join(basePath, args.themePath) : path.join(basePath, 'src', 'theme'); const outputPath = path.join(basePath, 'output', 'theme'); const themes: string[] = args.themes; + const themeVariablesFiles = themes.map((theme) => { + return path.join(themesPath, theme, 'variables.css'); + }); const postcssPresetConfig = { browsers: ['last 2 versions', 'ie >= 10'], @@ -29,13 +32,15 @@ export default function webpackConfigFactory(args: any): Configuration { }, autoprefixer: { grid: true - } + }, + importFrom: themeVariablesFiles }; const emitAll = emitAllFactory({ legacy: true, inlineSourceMaps: false, - basePath: themesPath + basePath: themesPath, + additionalAssets: themeVariablesFiles }); const tsLoaderOptions = {