Skip to content

Commit

Permalink
update build script to include lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
bgschiller committed Mar 5, 2018
1 parent b62f0f0 commit c7375a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@

print "Loading floorspace.js API script from: #{src_path + '/api.js'}\n\n"
api_scripts = File.open(src_path + '/api.js') {|file| file.read}
lodash = File.open('./node_modules/lodash/lodash.js') {|file| file.read}

# the newline after #{scripts} is important, removing it causes everything after #{scripts} to be interpreted as a comment
embeddable_html = base_html + "
<script> #{lodash} </script>
<script>
window.startApp = function() {
#{scripts}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"huebee": "^1.0.1",
"js-clipper": "^1.0.1",
"lodash": "^4.17.4",
"openlayers": "^4.1.0",
"openlayers": "^4.6.0",
"polylabel": "^1.0.2",
"proxy-polyfill": "^0.1.7",
"vue": "^2.4.4",
Expand Down
3 changes: 2 additions & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
window.api = {
config: null,
initAlreadyRun: false,
openFloorplan: (data, options = { noReloadGrid: false }) => {
openFloorplan: (data, _options) => {
const options = _options || { noReloadGrid: false };
try {
window.application.$store.dispatch('importFloorplan', {
clientWidth: document.getElementById('svg-grid').clientWidth,
Expand Down

0 comments on commit c7375a5

Please sign in to comment.