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

multicompiler build with webpack serve #15824

Closed
vankop opened this issue May 13, 2022 · 3 comments
Closed

multicompiler build with webpack serve #15824

vankop opened this issue May 13, 2022 · 3 comments

Comments

@vankop
Copy link
Member

vankop commented May 13, 2022

Bug report

Multicompiler build with dependencies fails with webpack serve and success with common webpack build

What is the current behavior?
build with webpack serve fails without building dependency compiler first.

If the current behavior is a bug, please provide the steps to reproduce.

https://github.com/vankop/webpack-serve-bug

  • run npm run build. it should successfully build
  • remove src2/build1.js
  • run npm run serve. it should fail

What is the expected behavior?
build succeeded

Other relevant information:
webpack version: latest
Node.js version:
Operating System:
Additional tools:

@webpack-bot
Copy link
Contributor

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@alexander-akait
Copy link
Member

bump

@alexander-akait
Copy link
Member

Yeah, it is intresting, by default when you run serve, we run dev server on both compiation (but we keep files in memory), to solve it we need:

  1. Allow to disable dev server for required compilation, here is issue serve does not work with multi-server webpack-cli#2408

As workaround now you can do it:

const path = require("path");

module.exports = [
    {
        mode: "production",
        name: "build1",
        entry: "./src1",
        output: { filename: "build1.js", path: path.resolve(__dirname, "src2") },
        devServer: {
            devMiddleware: {
                writeToDisk: true,
            }
        }
    },
    {
        mode: "production",
        name: "app",
        dependencies: ["build1"],
        entry: "./src2",
    }
];

I want to close the issue here (in favor webpack/webpack-cli#2408), because we should fix bug/implement enchantment in webpack-cli.

Feel free to feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants