Skip to content

building multiple web components in lerna project results in failure #4841

Open
@darrenjennings

Description

@darrenjennings

Version

4.0.5

Reproduction link

https://github.com/Kong/kongponents/

Environment info

Environment Info:

  System:
    OS: macOS Mojave 10.14
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.15.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.12.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.97
    Firefox: 68.0.1
    Safari: 12.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  3.12.1 
    @vue/babel-preset-jsx:  1.1.1 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.1.1 
    @vue/babel-sugar-v-on:  1.1.0 
    @vue/cli-overlay:  4.0.5 
    @vue/cli-plugin-router:  4.0.5 
    @vue/cli-plugin-vuex:  4.0.5 
    @vue/cli-service: 4.0.5 => 4.0.5 
    @vue/cli-shared-utils:  4.0.5 
    @vue/component-compiler-utils:  3.0.1 (2.6.0)
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/test-utils: 1.0.0-beta.28 => 1.0.0-beta.28 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: 4.5.0 => 4.5.0 
    jest-serializer-vue: 2.0.2 => 2.0.2 
    vue: 2.6.10 => 2.6.10 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.4 
    vue-inbrowser-compiler:  3.23.0 
    vue-jest: 3.0.2 => 3.0.2 
    vue-live:  1.4.4 
    vue-loader: 15.7.0 => 15.7.0 (15.7.2)
    vue-prism-editor:  0.3.0 
    vue-router: ^3.0.7 => 3.1.3 
    vue-server-renderer:  2.6.10 
    vue-style-loader:  4.1.2 
    vue-template-compiler: 2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuepress: ^1.0 => 1.2.0 
    vuepress-html-webpack-plugin:  3.2.0 
    vuepress-plugin-container:  2.1.0 
    vuepress-plugin-live: ^1.2.0 => 1.4.2 
    vuepress-plugin-smooth-scroll:  0.0.3 
    vuex: 3.0.1 => 3.0.1 
  npmGlobalPackages:
    @vue/cli: 3.0.0-beta.6

Steps to reproduce

In https://github.com/Kong/kongponents/, we are wanting to build components as web components:

  1. Run this command: yarn lerna exec "yarn vue-cli-service build --target wc \$(cat package.json | jq -r .source) --dest dist-wc"
  2. See entry.js file is generated inside node_modules/@vue/cli-service/lib/commands/build/entry-wc.js with window.customElements.define('k-card', wrap(Vue, kCard)) of one of the package names...
  3. failure because multiple commands are using same entry.js file with unknown package kCard

What is expected?

WC succeeds for every component, can run simultaneously, but it fails to build when building multiple at the same time.

What is actually happening?

I assume there are files generated for the builds, but they are not scoped so it doesn't support async builds.


It appears that if you run single command for package it runs successfully:
yarn vue-cli-service build --target wc packages/KButton/KButton.vue --dest dist-wc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions