File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 55 "main" : " dist/bundle.js" ,
66 "scripts" : {
77 "build" : " cross-env NODE_ENV=production webpack" ,
8+ "build-dev" : " cross-env NODE_ENV=development webpack" ,
89 "clean" : " cross-env rimraf dist coverage lib" ,
910 "coverage" : " cross-env npm run build && jest --coverage" ,
1011 "lint" : " cross-env eslint src --ext .js,.ts" ,
8384 "webpack-cli" : " 4.9.1" ,
8485 "webpack-node-externals" : " 3.0.0"
8586 }
86- }
87+ }
Original file line number Diff line number Diff line change @@ -59,7 +59,16 @@ class LoadingStoreValue implements Resource {
5959
6060 // Proxy to all other unknown properties: return a function that yields another LoadingStoreValue
6161 const loadProperty = loadResource . then ( resource => resource [ prop ] )
62- const result = templateParams => new LoadingStoreValue ( loadProperty . then ( property => property ( templateParams ) . _meta . load ) )
62+
63+ const result = templateParams => new LoadingStoreValue ( loadProperty . then ( property => {
64+ try {
65+ return property ( templateParams ) . _meta . load
66+ } catch ( e ) {
67+ throw new Error ( `Property '${ prop . toString ( ) } ' on resource ${ absoluteSelf } was used like a relation, but no relation with this name was returned by the API (actual return value: ${ JSON . stringify ( property ) } )` )
68+ }
69+ }
70+ ) )
71+
6372 result . toString = ( ) => ''
6473 return result
6574 }
Original file line number Diff line number Diff line change 1- var path = require ( 'path' )
2- var webpack = require ( 'webpack' )
3- var nodeExternals = require ( 'webpack-node-externals' )
1+ const path = require ( 'path' )
2+ const webpack = require ( 'webpack' )
3+ const nodeExternals = require ( 'webpack-node-externals' )
44
55module . exports = {
66 devtool : 'source-map' ,
@@ -16,7 +16,7 @@ module.exports = {
1616 plugins : [
1717 new webpack . DefinePlugin ( {
1818 'process.env' : {
19- NODE_ENV : JSON . stringify ( 'production' )
19+ NODE_ENV : JSON . stringify ( process . env . NODE_ENV )
2020 }
2121 } )
2222 ] ,
You can’t perform that action at this time.
0 commit comments