@symbo.ls/init 2.6.8 → 2.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +16 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/init",
3
- "version": "2.6.8",
3
+ "version": "2.6.9",
4
4
  "license": "MIT",
5
5
  "gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
6
6
  "source": "src/index.js",
package/src/index.js CHANGED
@@ -17,21 +17,32 @@ import DYNAMIC_JSON from './dynamic.json'
17
17
  const CONFIG = getActiveConfig()
18
18
 
19
19
  const prepareInit = (config = {}, RC_FILE) => {
20
- // const defaultConfig = merge(config, CONFIG_DEFAULT)
21
20
  const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
22
21
  return deepMerge(config, rcfile)
23
22
  }
24
23
 
25
- export const init = (config, RC_FILE, options = { emotion, initDOMQLDefine: true }) => {
24
+ const SET_OPTIONS = {
25
+ emotion,
26
+ useVariable: true,
27
+ useReset: true,
28
+ initDOMQLDefine: true
29
+ }
30
+
31
+ export const init = (config, RC_FILE, options = SET_OPTIONS) => {
26
32
  if (options.initDOMQLDefine) initDOMQLEmotion(options.emotion, options)
27
33
 
28
- const resultConfig = prepareInit(config)
34
+ const resultConfig = prepareInit(config, RC_FILE)
35
+
36
+ const conf = set({
37
+ verbose: false,
38
+ useReset: options.useReset,
39
+ ...resultConfig
40
+ }, { newConfig: options.newConfig })
29
41
 
30
- const conf = set({ verbose: false, ...resultConfig }, { newConfig: options.newConfig })
31
42
  const FontFace = getFontFaceString(conf.FONT)
32
43
 
33
44
  options.emotion.injectGlobal(FontFace)
34
- if (conf.useReset) options.emotion.injectGlobal(conf.RESET)
45
+ if (options.useReset) options.emotion.injectGlobal(conf.RESET)
35
46
 
36
47
  return conf
37
48
  }