Code Monkey home page Code Monkey logo

Comments (4)

valentineus avatar valentineus commented on June 18, 2024 1

I see this issue, but the method don't work.

externals: {
	'electron-reload': 'electron-reload',
},

Result:

A JavaScript error occurred in the main process
Uncaught Exception:
ReferenceError: electron is not defined
    at eval (webpack:///external_%22electron-reload%22?:1:18)
...

from electron-reload.

valentineus avatar valentineus commented on June 18, 2024

I've created a repository to test this situation.

from electron-reload.

valentineus avatar valentineus commented on June 18, 2024

I see the problem that is in the WebPack.

So I've found a solution to the problem. You should add a section to a config file.

node: {
  __dirname: false
}

Maybe, add this information to the README file?

WebPack example config
const path = require('path');

module.exports = {
  mode: "development",
  target: 'electron-main',
  entry: {
    main: './src/main.js'
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  module: {
    rules: [{
      test: /\.js$/,
      exclude: /(node_modules|bower_components)/,
      use: {
        loader: 'babel-loader',
        options: {
          babelrc: false,
          presets: ['@babel/preset-env']
        }
      }
    }]
  },
  node: {
    __dirname: false
  }
}

from electron-reload.

yan-foto avatar yan-foto commented on June 18, 2024

Hi @valentineus , thanks for getting involved in this project, but as you already found out, this is not a bug within electron-relaod. I'll close this issue and will add a note in README in future releases.

from electron-reload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.