Skip to content

build target lib should merge externals in vue.config #2646

@mattwmj

Description

@mattwmj

What problem does this feature solve?

I find that if build with vue-cli-service build --target lib, externals in vue.config.js is ignored.
Dig into the vue-cli source I find below code in resolveLibConfig.js which ignores externals in vue.config.js.
Is this intended or not?

    // externalize Vue in case user imports it
    config
        .externals({
            vue: {
                commonjs: 'vue',
                commonjs2: 'vue',
                root: 'Vue'
            }
        })

What does the proposed API look like?

// externalize Vue in case user imports it
        config
            .externals({
                ...config.get('externals')
                vue: {
                    commonjs: 'vue',
                    commonjs2: 'vue',
                    root: 'Vue'
                }
            }) 

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy