Open jstaro opened 6 years ago
See discussion in https://github.com/electron-userland/electron-webpack/issues/145#issuecomment-388873431
We should opt-out of implicit smart merging
Great. I'm all for more control over the webpack config.
In case anyone is still interested in this, I just created a PR to allow custom typescript loaders. The only caveat is that it's all or nothing. Either you choose the default two plugins, or your own custom ones.
If you'd like to check out the branch to test it, you'll have to compile the branch locally and install it from that directory.
Here are the steps.
// install lerna globally if you don't have it
yarn global add lerna
// then
git clone https://github.com/JM-Mendez/electron-webpack
cd electron-webpack
git checkout feat/custom-typescript-loaders
lerna bootstrap
BABEL_ENV=production yarn run compile
Then to install
yarn install path-to-electron-webpack/packages/electron-webpack
Normally, when using
transpileOnly
+ForkTsCheckerWebpackPlugin
, you want to do linting in theForkTsCheckerWebpackPlugin
(which it supports by supplying a config object{ tslint: '<path to tslint.json>'}
). It's a one-liner.Sadly, the current solution with hardcoded 'smart' webpack config merging does not allow you to replace (or remove) a plugin entry in the webpack config, so there's currently no way to add this support by yourself without losing CLI support :( (https://github.com/electron-userland/electron-webpack/issues/11, https://github.com/electron-userland/electron-webpack/issues/33, https://github.com/electron-userland/electron-webpack/issues/92). So, in lieu of a proper solution for more powerful config transformations, could TSLint be added as a plugin?