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

Support for typescript based webpack config #32

Open
sapkra opened this issue Jun 21, 2020 · 0 comments
Open

Support for typescript based webpack config #32

sapkra opened this issue Jun 21, 2020 · 0 comments

Comments

@sapkra
Copy link

sapkra commented Jun 21, 2020

I'm trying to use your library but I'm using a webpack config written in typescript. I've noticed a few problems.

  1. There is no manual how to use it with import statements.
  2. the index.d.ts just exports an empty object: export {};
  3. The following example is not working:
import path from 'path';
import initElectronReloadPlugin from 'webpack-electron-reload';

const ElectronReloadPlugin = initElectronReloadPlugin({
  path: path.join(__dirname, './build/main.js'),
});

export default {
  ...
  plugins: [
    ElectronReloadPlugin(),
  ],
};

It fails with

error TS2349: This expression is not callable.
[dev:main]   Type 'typeof import("/my-repository/node_modules/webpack-electron-reload/dist/index")' has no call signatures.

Using export default createWebpackElectronReloadPlugin in the index.ts of your plugin may fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant