@rws-framework/client 2.9.20 → 2.9.23

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.9.20",
4
+ "version": "2.9.23",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -70,11 +70,19 @@ const RWSWebpackWrapper = async (config) => {
70
70
 
71
71
  //AFTER OPTION DEFINITIONS
72
72
 
73
+ let _rws_defines = {
74
+ 'process.env._RWS_DEFAULTS': JSON.stringify(BuildConfigurator.exportDefaultConfig()),
75
+ 'process.env._RWS_BUILD_OVERRIDE': JSON.stringify(BuildConfigurator.exportBuildConfig())
76
+ }
77
+
78
+ const rwsDefines = BuildConfigurator.get('rwsDefines') || config.rwsDefines || null;
79
+
80
+ if(rwsDefines){
81
+ _rws_defines = {..._rws_defines, ...rwsDefines}
82
+ }
83
+
73
84
  let WEBPACK_PLUGINS = [
74
- new webpack.DefinePlugin({
75
- 'process.env._RWS_DEFAULTS': JSON.stringify(BuildConfigurator.exportDefaultConfig()),
76
- 'process.env._RWS_BUILD_OVERRIDE': JSON.stringify(BuildConfigurator.exportBuildConfig())
77
- }),
85
+ new webpack.DefinePlugin(_rws_defines),
78
86
  new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en-gb/),
79
87
  new webpack.IgnorePlugin({
80
88
  resourceRegExp: /.*\.es6\.js$/,
@@ -29,9 +29,9 @@ class ConfigService extends TheService {
29
29
  }
30
30
 
31
31
 
32
- const isInDefaults: boolean = Object.keys(this._DEFAULTS).includes(key);
33
- const isInData: boolean = Object.keys(this.data).includes(key);
34
- const isInBuildVars: boolean = Object.keys(this._BUILD_OVERRIDE).includes(key);
32
+ const isInDefaults: boolean = Object.keys(this._DEFAULTS).includes(key as string);
33
+ const isInData: boolean = Object.keys(this.data).includes(key as string);
34
+ const isInBuildVars: boolean = Object.keys(this._BUILD_OVERRIDE).includes(key as string);
35
35
 
36
36
  let isDev = false;
37
37
 
@@ -50,7 +50,7 @@ class ConfigService extends TheService {
50
50
  defaultVal = this.data[((defaultVal as string).slice(1)) as keyof IRWSConfig];
51
51
  }
52
52
 
53
- if(isInBuildVars && Object.keys(this._BUILD_OVERRIDE).includes(key)){
53
+ if(isInBuildVars && Object.keys(this._BUILD_OVERRIDE).includes(key as string)){
54
54
  if(isDev){
55
55
  console.warn(`.rws.json override [${key}]:`), this._BUILD_OVERRIDE[key];
56
56
  }
@@ -6,6 +6,7 @@ export type IFrontRoutes = Record<string, unknown>;
6
6
  export type RWSPluginEntry<T extends DefaultRWSPluginOptionsType = DefaultRWSPluginOptionsType> = new (...args: any[]) => RWSPlugin<T>;
7
7
 
8
8
  export default interface IRWSConfig {
9
+ [key: string]: any
9
10
  dev?: boolean
10
11
  defaultLayout?: typeof RWSViewComponent
11
12
  backendUrl?: string
@@ -20,7 +21,8 @@ export default interface IRWSConfig {
20
21
  pubUrlFilePrefix?: string
21
22
  partedDirUrlPrefix?: string
22
23
  dontPushToSW?: boolean
23
- parted?: boolean
24
+ parted?: boolean,
25
+ rwsDefines?: {[key: string]: any}
24
26
  partedFileDir?: string
25
27
  partedPrefix?: string
26
28
  plugins?: IStaticRWSPlugin[]