-
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 8289447
Showing
10 changed files
with
58 additions
and
28 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,31 @@ | ||
/** | ||
* Ensure the user's app only uses our one copy of jQuery and SUI jQuery plugins. | ||
*/ | ||
import _ from 'lodash' | ||
import { makeDebugger } from './debug' | ||
|
||
const debug = makeDebugger('jquery') | ||
|
||
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(' ')) | ||
} | ||
|
||
debug('Loading jQuery') | ||
// load jQuery, then load SUI jQuery | ||
window.jQuery = window.$ = require('jquery') | ||
|
||
debug('Loading SUI Checkbox plugin') | ||
require('semantic-ui-css/components/checkbox') | ||
|
||
debug('Loading SUI Form plugin') | ||
require('semantic-ui-css/components/form') | ||
|
||
debug('Loading SUI Progress plugin') | ||
require('semantic-ui-css/components/progress') |