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

Possible issue with webpack copy plugin #1391

Closed
frankandrobot opened this issue Aug 12, 2022 · 1 comment
Closed

Possible issue with webpack copy plugin #1391

frankandrobot opened this issue Aug 12, 2022 · 1 comment

Comments

@frankandrobot
Copy link
Contributor

What's wrong?

We use the webpack-copy-plugin to copy a fonts directory. As per this issue, the copy plugin can trigger infinite loops in the webpack watch process. The workaround is to explicitly ignore the files that change. In this case, we ignore public and fonts (as shown below). So in theory, it should work but it doesn't. And so there is a possibility that cosmos is ignoring the webpack watch ignore options:

 // webpack config
  // copy the folder
  plugins: [
    new CopyPlugin({
      patterns: [{ from: "public/fonts/", to: "fonts/" }],
    }),
  ],
  // don't watch these folders but this seems to be ignored
  watchOptions: {
    ignored: ["**/fonts/", "**/public/"],
  },

Steps to reproduce

  1. Use the webpack copy plugin
  2. Ignore the files that are copied
  3. Make a change in cosmos, and watch webpack build forever :-)
@frankandrobot
Copy link
Contributor Author

So yea this was just a misunderstanding of how cosmos worked. Overriding the watch options via overridePath did the trick!

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