Skip to content

Commit 0084730

Browse files
committed
shims for build
1 parent d157d6f commit 0084730

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,11 @@
7878
"pc-bootstrap4-datetimepicker": "^4.17.50",
7979
"typeahead.js": "^0.10.5",
8080
"uuid": "^3.2.1"
81-
}
81+
},
82+
"browserify": {
83+
"transform": [
84+
"browserify-shim"
85+
]
86+
},
87+
"browserify-shim": "./src/js/shim.js"
8288
}

src/js/shim.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* shim.js
3+
*
4+
* browserify-shim configuration
5+
*
6+
* primarily deals with ensuring jQuery is available globally in
7+
* the window, which is where it is expected by packages like
8+
* Bootstrap.js and Typeahead.js
9+
*
10+
*/
11+
12+
module.exports = {
13+
'../../node_modules/jquery/dist/jquery.js': {
14+
'exports': '$'
15+
},
16+
'../../node_modules/jquery/dist/jquery.js': {
17+
'exports': 'jQuery'
18+
},
19+
'../../node_modules/bootstrap/dist/js/bootstrap.js': {
20+
'depends': [
21+
'../../node_modules/jquery/dist/jquery.js:jQuery',
22+
'../../node_modules/jquery/dist/jquery.js:$'
23+
]
24+
},
25+
// '../../node_modules/typeahead.js/dist/bloodhound.js': {
26+
// 'exports': 'Bloodhound'
27+
// },
28+
// '../../node_modules/typeahead.js/dist/typeahead.jquery.js': {
29+
// 'depends': {
30+
// '../../node_modules/jquery/dist/jquery.js': null
31+
// }
32+
// }
33+
}

0 commit comments

Comments
 (0)