Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for newer electron #375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function configureStore(

const enhancer = compose(
applyMiddleware(...middleware),
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
// window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)

const store = createStore(persistedReducer, initialState, enhancer)
Expand Down
17 changes: 11 additions & 6 deletions config/webpack/webpack.config.renderer.dev.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ const port = process.env.PORT || 1212
const publicPath = `http://localhost:${port}/dist`
const dll = path.resolve(process.cwd(), 'dll')
const manifest = path.resolve(dll, 'vendor.json')
const requiredByDLLConfig = module.parent.filename.includes(
'webpack.config.renderer.dev.dll'
)

/**
* Warn if the DLL is not built
*/
if (!(fs.existsSync(dll) && fs.existsSync(manifest))) {
if (!requiredByDLLConfig && !(fs.existsSync(dll) && fs.existsSync(manifest))) {
console.log(
chalk.black.bgYellow.bold(
'The DLL files are missing. Sit back while we build them for you with "npm run build-dll"'
Expand Down Expand Up @@ -104,11 +107,13 @@ export default merge.smart(baseConfig, {
},

plugins: [
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require(manifest), // eslint-disable-line import/no-dynamic-require
sourceType: 'var',
}),
requiredByDLLConfig
? null
: new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require(manifest), // eslint-disable-line import/no-dynamic-require
sourceType: 'var',
}),

new webpack.HotModuleReplacementPlugin({
multiStep: true,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"hot-updates-server": "node config/scripts/webpack hot-server",
"start-hot-renderer": "node config/scripts/hot-renderer",
"postinstall": "npm run build:dll && electron-builder install-app-deps",
"package": "npm run build && build --publish never",
"package": "npm run build && electron-builder --publish never",
"release": "npm run build && build"
},
"lint-staged": {
Expand Down Expand Up @@ -79,6 +79,7 @@
"react-redux": "^7.0.0",
"react-sortable-pane": "^1.0.4",
"redux": "^4.0.1",
"redux-devtools": "^3.5.0",
"redux-persist": "^5.10.0",
"redux-saga": "^1.0.2",
"reselect": "^4.0.0",
Expand Down