Skip to content

Make final webpack.config.js can be acessed (import/require)  #782

@DrSensor

Description

@DrSensor

What problem does this feature solve?

There are cases when I need to use another cli (in my case are dotnet and start-storybook) for running some of my project. To run it properly, final webpack.config.js (sum of = vue.config.js + default vue config + all config of vue-cli-plugin-*) need to be acessed so it can be merged with another default webpack config (storybook) or integrate webpack hot-reload and its config into another server side framework.

What does the proposed API look like?

I can only think 2 solution for this:

1. Expose chainableConfig

So user can do something like:

const { chainableConfig } = require('@vue/cli')
const mergeWebpack = require('webpack-merge') 

// this is storybook way for extending config
module.exports = (baseConfig, env, defaultConfig) => mergeWebpack(chainableConfig.toConfig(), defaultConfig)

However, the problem with this approach is I can't merge it with another server side framework that use another programing language (in my case are ASP.NET Core using webpack-aspnet-middleware)

2. Unfortunately vue eject

Implement eject command to output the final config into a file. This way I can point exactly where webpack.config.js are in my ASP.NET startup module. However, to make it safe, every time server-side cli run/start/build then vue eject need to be executed first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions