File tree 5 files changed +18
-5
lines changed
5 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 6
6
"jasmine" : true
7
7
},
8
8
"globals" : {
9
+ "__ENV__" : true
9
10
},
10
11
"rules" : {
11
12
"no-useless-escape" : " off"
Original file line number Diff line number Diff line change 149
149
"test:browser" : " grunt dev" ,
150
150
"lint" : " eslint ." ,
151
151
"lint:fix" : " eslint . --fix" ,
152
- "build" : " rm -rf dist/public; webpack --config webpack/webpack.config.js && webpack --config webpack/webpack.min.config.js" ,
153
- "build:watch" : " webpack -w --config webpack/webpack.config.js" ,
152
+ "build" : " rm -rf dist/public; NODE_ENV=production webpack --config webpack/webpack.config.js && NODE_ENV=production webpack --config webpack/webpack.min.config.js" ,
153
+ "build:watch" : " NODE_ENV=development webpack -w --config webpack/webpack.config.js" ,
154
154
"build:internal" : " grunt build" ,
155
155
"docs" : " rm -rf docs/public; jsdoc --configure config/jsdoc/public-conf.json" ,
156
156
"docs:internal" : " rm -rf docs/internal; jsdoc --configure config/jsdoc/internal-conf.json" ,
Original file line number Diff line number Diff line change @@ -291,20 +291,26 @@ Engine.prototype._buildOptions = function (options) {
291
291
* @private
292
292
*/
293
293
Engine . prototype . _buildParams = function ( includeFilters ) {
294
- var params = {
295
- client : this . _windshaftSettings . client
296
- } ;
294
+ var params = { } ;
295
+
296
+ if ( __ENV__ === 'production' ) {
297
+ params . client = this . _windshaftSettings . client ;
298
+ }
299
+
297
300
if ( includeFilters && ! _ . isEmpty ( this . _dataviewsCollection . getFilters ( ) ) ) {
298
301
params . filters = this . _dataviewsCollection . getFilters ( ) ;
299
302
}
303
+
300
304
if ( this . _windshaftSettings . apiKey ) {
301
305
params . api_key = this . _windshaftSettings . apiKey ;
302
306
return params ;
303
307
}
308
+
304
309
if ( this . _windshaftSettings . authToken ) {
305
310
params . auth_token = this . _windshaftSettings . authToken ;
306
311
return params ;
307
312
}
313
+
308
314
console . warn ( 'Engine initialized with no apiKeys neither authToken' ) ;
309
315
} ;
310
316
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ module.exports = {
12
12
} ,
13
13
devtool : 'sourcemap' ,
14
14
plugins : [
15
+ new webpack . DefinePlugin ( {
16
+ __ENV__ : JSON . stringify ( process . env . NODE_ENV )
17
+ } ) ,
15
18
// Include only the lastest camshaft-reference
16
19
new webpack . IgnorePlugin ( / ^ \. \/ ( (? ! 0 \. 5 9 \. 4 ) .) * \/ r e f e r e n c e \. j s o n $ / ) ,
17
20
new webpack . BannerPlugin ( banner )
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ module.exports = {
12
12
libraryTarget : 'umd'
13
13
} ,
14
14
plugins : [
15
+ new webpack . DefinePlugin ( {
16
+ __ENV__ : JSON . stringify ( process . env . NODE_ENV )
17
+ } ) ,
15
18
// Include only the lastest camshaft-reference
16
19
new webpack . IgnorePlugin ( / ^ \. \/ ( (? ! 0 \. 5 9 \. 4 ) .) * \/ r e f e r e n c e \. j s o n $ / ) ,
17
20
new UglifyJsPlugin ( ) ,
You can’t perform that action at this time.
0 commit comments