fix: read __CSS_PARSER__ from config (#9290)

* fix: read __CSS_PARSER__ from config

* fix: missing import and default value

* imports order
This commit is contained in:
Martin Guillon
2021-03-31 21:27:29 +02:00
committed by GitHub
parent c2aca14dd5
commit a7771cc8ab

View File

@ -14,6 +14,7 @@ import { WatchStatePlugin } from '../plugins/WatchStatePlugin';
import { hasDependency } from '../helpers/dependencies';
import { applyDotEnvPlugin } from '../helpers/dotEnv';
import { env as _env, IWebpackEnv } from '../index';
import { getValue } from '../helpers/config';
import { getIPS } from '../helpers/host';
import {
getPlatformName,
@ -294,7 +295,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
__NS_ENV_VERBOSE__: !!env.verbose,
__NS_DEV_HOST_IPS__:
mode === 'development' ? JSON.stringify(getIPS()) : `[]`,
__CSS_PARSER__: JSON.stringify('css-tree'), // todo: replace from config value
__CSS_PARSER__: JSON.stringify(getValue('cssParser', 'css-tree')),
__ANDROID__: platform === 'android',
__IOS__: platform === 'ios',
/* for compat only */ 'global.isAndroid': platform === 'android',