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

The typings issue while upgrade to webpack@5.1.3 #188

Open
tianyingchun opened this issue Oct 19, 2020 · 7 comments
Open

The typings issue while upgrade to webpack@5.1.3 #188

tianyingchun opened this issue Oct 19, 2020 · 7 comments

Comments

@tianyingchun
Copy link

after we upgrade to webpack@5 it will throw typings errors

// `clean-webpack-plugin.d.ts`
import { Compiler, Stats, Compilation as compilnType } from 'webpack';
declare type Compilation = compilationType.Compilation;
export interface Options {
....
}

Maybe it should changed to

import { Compiler, Stats, Compilation } from 'webpack';
export interface Options {
....
}
ribose-jeffreylau added a commit to riboseinc/clean-webpack-plugin that referenced this issue Nov 18, 2020
ribose-jeffreylau added a commit to riboseinc/clean-webpack-plugin that referenced this issue Nov 20, 2020
shanedg added a commit to shanedg/trshcmpctr that referenced this issue Nov 28, 2020
Adjust "splitChunks" config values. Upgrade html-webpack-plugin to v5
prerelease to silence deprecation warning. Upgrade terser-webpack-plugin
to v5. Remove clean-webpack-plugin because not ready for v5.
See johnagan/clean-webpack-plugin#182 and
johnagan/clean-webpack-plugin#188.
shanedg added a commit to shanedg/trshcmpctr that referenced this issue Nov 28, 2020
Adjust "splitChunks" config values. Upgrade html-webpack-plugin to v5
prerelease to silence deprecation warning. Upgrade terser-webpack-plugin
to v5. Remove clean-webpack-plugin because not ready for v5.
See johnagan/clean-webpack-plugin#182 and
johnagan/clean-webpack-plugin#188. Remove
progress-bar-webpack-plugin because of weird v5 double completion.
Remove chalk, only used by progress bar.
@joeldenning
Copy link

Is there any known workaround for this? For now I am removing clean-webpack-plugin from shared webpack configs in create-single-spa, since it throws typescript errors with webpack 5.

@strootje
Copy link
Contributor

strootje commented Jan 6, 2021

@johnagan I am trying to update this package to webpack v5. But would like some help. See my branch: master...strootje:update-webpack-v5

It seems that the .map files aren't being removed. which makes me assume that they've been removed from the assets map. Got any clue's?

@tianyingchun
Copy link
Author

what progress about this issue

@alexander-akait
Copy link

You don't need this plugin with webpack v5, please look at output.clean: true option

@shanedg
Copy link

shanedg commented Mar 3, 2021

@alexander-akait thanks for pointing this out! At the moment, Webpack 5 guides still recommend this plugin for cleaning the dist/ folder and a clean option is missing under output configuration.

FYI there's a new, internal CleanPlugin

Here's the relevant bit in the Webpack 5 src: https://github.com/webpack/webpack/blob/master/lib/WebpackOptionsApply.js#L181-L186

@johnagan
Copy link
Owner

johnagan commented Mar 3, 2021

FYI there's a new, internal CleanPlugin

That's great! I would be happy to deprecate this one since I don't have time to spend on it anymore.

@alexander-akait
Copy link

@shanedg docs was updated https://webpack.js.org/guides/output-management/#cleaning-up-the-dist-folder

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

6 participants