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

[ENHANCEMENT]: Yarn PnP support for serve command #1080

Closed
vhiairrassary opened this issue Sep 20, 2019 · 7 comments
Closed

[ENHANCEMENT]: Yarn PnP support for serve command #1080

vhiairrassary opened this issue Sep 20, 2019 · 7 comments

Comments

@vhiairrassary
Copy link

Is your feature request related to a problem? Please describe.

When using yarn v2, we can't use serve as @webpack-cli/serve is not declared as a dependency. It should be be declared as an optional peer dependency. Same for webpack-dev-server:

{
  "peerDependencies": {
    "@webpack-cli/serve": "*",
    "webpack-dev-server": "*"
  },
  "peerDependenciesMeta": {
    "@webpack-cli/serve": {
      "optional": true
    },
    "webpack-dev-server": {
      "optional": true
    }
  }
}

Additional context

Similar work for webpack-dev-server: webpack/webpack-dev-server#2191 (but not enough as next major version will not include the webpack-dev-server binary, and we will have to use webpack-cli)

Optional peer dependencies RFC: https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-optional-peer-dependencies.md

@evenstensberg
Copy link
Member

Yep we can do that, will need for #1011 to land then we can fix this.

@evenstensberg evenstensberg changed the title Yarn PnP support for serve command [ENHANCEMENT]: Yarn PnP support for serve command Sep 20, 2019
@evenstensberg
Copy link
Member

@Loonride could you pick this up? Would greatly appreciate it and we really need it.

CC @evilebottnawi

@knagaitsev
Copy link
Contributor

@Loonride could you pick this up? Would greatly appreciate it and we really need it.

CC @evilebottnawi

@evenstensberg I already added webpack-dev-server as optional peer dependency here:

"peerDependencies": {
"webpack-dev-server": ">=4.0.0"
},
"peerDependenciesMeta": {
"webpack-dev-server": {
"optional": true
}
},

Do we need this for all the packages (serve, init, etc.)?

@alexander-akait
Copy link
Member

alexander-akait commented Oct 3, 2019

What @webpack-cli/serve is it?

@alexander-akait
Copy link
Member

For webpack-dev-server all solved

@alexander-akait
Copy link
Member

alexander-akait commented Oct 3, 2019

@evenstensberg should you install @webpack-cli/serve for using webpack serve?

Oh my god, seriously? Where is 0CJS?

Basic commands like:

  1. Run webpack
  2. Generate first configuration
  3. Run dev server
  4. Output information like env/config/etc

should works out of box without any additional installation.

@alexander-akait
Copy link
Member

Look at the others CLI programs, no one forces you to install additional modules for basic work

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

5 participants