Closed muuvmuuv closed 5 years ago
Can you try changing the import to:
import BuildNotifier from 'webpack-build-notifier';
This was the method I used before, but now it seems like it does not work anymore...
Module '"..../node_modules/webpack-build-notifier/index"' has no default export. ts(1192)
Ah, looks like there was no default export in the TS definition. Can you please upgrade to 0.1.32 and try again please?
Nope, still getting this error above. You can have a look at my webpack file here: https://github.com/muuvmuuv/vscode-sundial/blob/master/webpack.config.ts.off
OK -- found that the TS definition implied that this plugin is exported as a default ES6 export, which isn't the case (it's currently a commonJS module). I corrected the definition, but now you will need to upgrade to version 1.0.0 and change your import to import * as WebpackBuildNotifierPlugin from 'webpack-build-notifier'
.
Let me know how it goes!
@RoccoC did u pushed the version to NPM? I get no update. np. I will add it manually in my node_modules for testing
Yes, copied index.d.ts and index.js content into my node_modules and it worked! Thanks :)
Nevermind, I forgot to do npm i webpack-build-notifier@latest
..
Glad it worked out! Thanks!
When running webpack with ts-node (webpack.config.ts) I get this error:
In a basic JS node application everything seems fine. Maybe this is because
webpack-build-notifier
in not a class?I import it with
import { WebpackBuildNotifierPlugin as BuildNotifier } from 'webpack-build-notifier'
.If it is because it is not a class, it would be great if someone would rewrite it to a class. Here is an example of a good TypeScript written webpack plugin: https://github.com/johnagan/clean-webpack-plugin/blob/master/src/clean-webpack-plugin.ts