@rws-framework/client 2.9.20 → 2.9.22

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.22",
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$/,
@@ -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[]