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

Feature Watch Config (postcss.config.js) added in v1.2.2 was broken in v5.0.0 #551

Closed
nolimitdev opened this issue Nov 25, 2021 · 2 comments · Fixed by #553
Closed

Feature Watch Config (postcss.config.js) added in v1.2.2 was broken in v5.0.0 #551

nolimitdev opened this issue Nov 25, 2021 · 2 comments · Fixed by #553

Comments

@nolimitdev
Copy link
Contributor

Bug report

Feature Watch Config (postcss.config.js) added in v1.2.2 exactly here 0c8c07d was broken in v5.0.0 exactly here 21008cc by changing loaderContext.addDependency(result.filepath); to loaderContext.addBuildDependency(result.filepath);. It is hard to find specification for that methods addDependency() addBuildDependency() and other similar addMissingDependency() addContextDependency() addContextDependency() what is the difference. Since v5.0.0 (including latest v6.2.0) when I touch/modify postcss.config.js nothing happens. When I temporary change addBuildDependency() back to addDependency() in node_modules/postcss-loader/src/utils.js
recompiling works again.

Actual Behavior

Since v5.0.0 (including latest v6.2.0) when I touch/modify postcss.config.js nothing happens.

Expected Behavior

When I touch/modify postcss.config.js webpack should recompile.

How Do We Reproduce?

Touch/modify postcss.config.js

Please paste the results of npx webpack info here, and mention other relevant information

System:
OS: Windows
Binaries:
Node: 12.22.7
npm: 6.14.15
Packages:
babel-loader: 8.2.3 => 8.2.3
css-loader: 6.5.1 => 6.5.1
css-minimizer-webpack-plugin: 3.1.4 => 3.1.4
postcss-loader: 6.2.0 => 6.2.0
terser-webpack-plugin: 5.2.5 => 5.2.5
vue-loader: 16.8.3 => 16.8.3
vue-style-loader: 4.1.3 => 4.1.3
webpack: 5.64.2 => 5.64.2
webpack-build-notifier: 2.3.0 => 2.3.0
webpack-cli: 4.9.1 => 4.9.1
webpack-dev-server: 4.5.0 => 4.5.0

@alexander-akait
Copy link
Member

Please create reproducible test repo

@nolimitdev
Copy link
Contributor Author

nolimitdev commented Nov 26, 2021

Here you are
https://github.com/nolimitdev/postcss-loader-watch-config-bug

Ogininaly I thought it could be Windows OS based problem but I have tested this reproducible repo on debian with the same result - watch of config does not work. It is interesting that small change from addDependency() to addBuildDependency() caused this issue. It would be nice to get definitions for that two methods and what is the difference. Here https://webpack.js.org/api/loaders/ is just addDependency() and addBuildDependency() but other such as addBuildDependency() and addMissingDependency() are missing (maybe are considered private?). I was looking into source code of webpack but there are no useful comments.

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

Successfully merging a pull request may close this issue.

2 participants