Skip to content

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

Closed
@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