Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,24 @@ module.exports = {
hot: true,
liveReload: false,
},
externals: {
'jquery': 'jQuery',
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
externals: Object.assign(
{},
{
'jquery': 'jQuery',
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
moment: 'moment',
lodash: 'lodash',
// WordPress components are too heavy to extern because we only use a few components.
},
! isDev ? {
// Dev mode cannot use external react-dom because HMR requires patched @hot-loader/react-dom
react: 'React',
'react-dom': 'ReactDOM',
} : undefined
),
module: {
rules: [
{
Expand Down