Closed arcticShadow closed 9 years ago
I have the following config in my package.json:
"browser": { "uikit": "./node_modules/uikit/dist/js/uikit.js", "uikit.css": "./node_modules/uikit/dist/css/uikit.css", "uikit/autocomplete": "./node_modules/uikit/dist/js/components/autocomplete.js", "uikit/autocomplete.css": "./node_modules/uikit/dist/css/components/autocomplete.css", "uikit/pagination": "./node_modules/uikit/dist/js/components/pagination.js" }, "browserify": { "transform": [ "browserify-shim", "browserify-css" ] }, "browserify-shim": { "uikit": { "exports": "UIkit", "depends": [ "jquery:window.jQuery", "uikit.css" ] }, "uikit/autocomplete": { "depends": [ "uikit:window.UIkit" ] }
As you may be able to tell, I am trying to get uikit to play nicely with CommonJS style loading.
The above works. in my Javascript files, i can
import uikit from 'uikit'; import uikitautocomplete from 'uikitautocomplete'
And both uikit and uikitautocomplete are available on the uikit object. (This is the way uikit works)
uikit
uikitautocomplete
However, I have noticed that UIkit and jQuery objects are available globally whenever I import uikit. Can i stop this from happenning?
UIkit
jQuery
import
Short answer is no, verdict is here: https://github.com/thlorenz/browserify-shim/issues/137#issuecomment-84628544
Ahh bother. Thanks for that link - missed it when i looked earlier.
I have the following config in my package.json:
As you may be able to tell, I am trying to get uikit to play nicely with CommonJS style loading.
The above works. in my Javascript files, i can
And both
uikit
anduikitautocomplete
are available on theuikit
object. (This is the way uikit works)However, I have noticed that
UIkit
andjQuery
objects are available globally whenever Iimport
uikit. Can i stop this from happenning?