vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

Bundle that Registers Multiple Web Components #5118

Closed rlweb closed 4 years ago

rlweb commented 4 years ago

Version

4.1.2

Environment info


Environment Info:

  System:
    OS: macOS 10.15.2
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 8.16.0 - ~/.nvm/versions/node/v8.16.0/bin/node
    Yarn: 1.0.1 - /usr/local/bin/yarn
    npm: 6.12.1 - ~/.nvm/versions/node/v8.16.0/bin/npm
  Browsers:
    Chrome: 79.0.3945.130
    Firefox: 71.0
    Safari: 13.0.4
  npmPackages:
    @ascendancyy/vue-cli-plugin-stylelint: ^1.1.2 => 1.1.2 
    @kazupon/vue-i18n-loader: ^0.3.0 => 0.3.0 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app: ^4.0.5 => 4.0.5 (3.12.1)
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  3.12.1 
    @vue/cli-plugin-babel: ^3.12.1 => 3.12.1 
    @vue/cli-plugin-eslint: ^3.12.1 => 3.12.1 
    @vue/cli-plugin-unit-mocha: ^3.12.1 => 3.12.1 
    @vue/cli-service: ^3.12.1 => 3.12.1 
    @vue/cli-shared-utils:  3.12.1 
    @vue/component-compiler-utils:  3.0.0 
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/test-utils: ^1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper: ^1.2.0 => 1.2.0 
    ag-grid-vue: ^20.2.0 => 20.2.0 
    babel-helper-vue-jsx-merge-props:  2.0.3 
    eslint-plugin-vue: ^5.2.3 => 5.2.3 (4.7.1)
    highcharts-vue: ^1.3.5 => 1.3.5 
    jest-serializer-vue: ^2.0.2 => 2.0.2 
    svg-to-vue:  0.4.0 
    typescript:  3.7.2 
    vue: ^2.6 => 2.6.10 
    vue-axios: ^2.1.5 => 2.1.5 
    vue-class-component:  6.3.2 
    vue-cli-plugin-i18n: ^0.5.2 => 0.5.2 
    vue-cli-plugin-styleguidist: ^3.26.2 => 3.26.2 
    vue-cli-plugin-webpack-bundle-analyzer: ^2.0.0 => 2.0.0 
    vue-date-fns: ^1.1.0 => 1.1.0 
    vue-docgen-api:  3.26.0 
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-extend-layout: ^2.0.6 => 2.0.6 
    vue-gtag: ^1.1.1 => 1.1.1 
    vue-hot-reload-api:  2.3.4 
    vue-i18n: ^8.15.0 => 8.15.0 
    vue-i18n-ts:  0.1.0 
    vue-inbrowser-compiler:  3.23.0 
    vue-loader:  15.7.2 
    vue-password-strength-meter: ^1.6.1 => 1.6.1 
    vue-property-decorator: ^7.3.0 => 7.3.0 
    vue-router: ^3.1 => 3.1.3 
    vue-style-loader:  4.1.2 
    vue-styleguidist:  3.26.2 
    vue-svg-loader: ^0.12.0 => 0.12.0 
    vue-template-compiler: ^2.6 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.1.1 => 3.1.1 
  npmGlobalPackages:
    @vue/cli: 4.1.2

Steps to reproduce

Based on https://cli.vuejs.org/guide/build-targets.html#bundle-that-registers-multiple-web-components

I should be able to run vue build --target wc --name foo 'src/components/layout/*.vue'

What is expected?

A build completes with multiple components built into the wc bundle.

What is actually happening?

$ vue build --target wc --name foo 'src/components/layout/*.vue' 
Entry file src/components/layout/*.vue does not exist.

There's a package.json in the current directory.
Did you mean npm run build?
LinusBorg commented 4 years ago

As the error states: do you really want to call the prototyping command vue build ?

You likely want to call npm run build (which calls vue-cli-service build)

rlweb commented 4 years ago

But that's not the issue here! It works when I don't use a glob within the filename aha.

LinusBorg commented 4 years ago

But that's not the issue here

...but that's the issue that the error message is about.

It works when I don't use a glob within the filename aha.

That's new information. And still correct, in a way. As per the docs, vue build is specifically explained as building one .js or .vue file, not a glob.

The part of the docs that you linked to is about vue-cli-service build.

Please provide a runnable reproduction before we continue to think about theoreticals and end up talking about different problems.

haoqunjiang commented 4 years ago

Closing due to inactivity