Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
feat: Remove jquery from externals
Browse files Browse the repository at this point in the history
  • Loading branch information
SofiaSousa committed Nov 16, 2018
1 parent 67ce5b7 commit 16c345d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ module.exports = {
}
```

GutenbergJS expects to find React (v16.4.1), ReactDOM (v16.4.1), moment (v2.22.1), jQuery (v1.12.4) and lodash (v4.17.5) libraries in the environment it runs. Maybe you would add the following lines to your pages.
GutenbergJS expects to find React (v16.4.1), ReactDOM (v16.4.1), moment (v2.22.1) and lodash (v4.17.5) libraries in the environment it runs. Maybe you would add the following lines to your pages.

```html
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/[email protected]/min/moment.min.js"></script>
<script src="https://unpkg.com/[email protected]/lodash.min.js"></script>
<script>window.lodash = _.noConflict();</script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
```

[↑ Go up to Table of contents](#table-of-contents)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@wordpress/url": "2.3.0",
"@wordpress/viewport": "^2.0.11",
"@wordpress/wordcount": "^2.0.3",
"jquery": "^3.3.1",
"tinymce": "4.8.0"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/js/init/wp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import jQuery from 'jquery';

window.jQuery = window.jQuery || jQuery;
window.wp = window.wp || {};

// User settings
Expand All @@ -8,7 +11,6 @@ window.userSettings = window.userSettings || {
};

// API settings

window.wpApiSettings = window.wpApiSettings || {};
window.wpApiSettingsroot = window.wpApiSettings.root || window.location.origin;
window.wpApiSettingsnonce = window.wpApiSettings.nonce || '123456789';
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const externals = {
react: 'React',
'react-dom': 'ReactDOM',
moment: 'moment',
jquery: 'jQuery',
lodash: 'lodash',
'lodash-es': 'lodash',
};
Expand Down

0 comments on commit 16c345d

Please sign in to comment.