-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(package): bundle jquery and sui js
- Loading branch information
1 parent
bfd5770
commit 4a655cb
Showing
10 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Ensure the user's app only uses our one copy of jQuery and SUI jQuery plugins. | ||
*/ | ||
import _ from 'lodash' | ||
|
||
let jQuery | ||
if (window.jQuery) jQuery = window.jQuery | ||
else if (_.get(window, '$.prototype.jquery')) jQuery = window.$ | ||
|
||
if (jQuery) { | ||
throw new Error([ | ||
'Do not load jQuery, it is bundled with Stardust.', | ||
'Stardust will soon be jQuery free: https://github.com/TechnologyAdvice/stardust/issues/247.', | ||
].join(' ')) | ||
} | ||
|
||
console.log('...Loading jQuery') | ||
// load jQuery, then load SUI jQuery | ||
window.jQuery = window.$ = require('jquery') | ||
|
||
console.log('...Loading SUI Checkbox plugin') | ||
require('semantic-ui-css/components/checkbox') | ||
|
||
console.log('...Loading SUI Form plugin') | ||
require('semantic-ui-css/components/form') | ||
|
||
console.log('...Loading SUI Progress plugin') | ||
require('semantic-ui-css/components/progress') |