Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extractCSS option to schema to enable override of extract-css plugin settings #1061

Closed
mediaessenz opened this issue Mar 30, 2018 · 2 comments

Comments

@mediaessenz
Copy link

What problem does this feature solve?

Currently it is IMO not possible to override the filename of an extracted css, by defining an extractCSS object in the vue.config.js.
The object itself would be already used here:

const userOptions = options.extractCSS && typeof options.extractCSS === 'object'

but is not allowed by the schema, defined in options.js of the parent dir.

What does the proposed API look like?

Add extractCSS: joi.object() to the schema definition inside cli-service/lib/options.js

@mediaessenz
Copy link
Author

mediaessenz commented Mar 31, 2018

Meanwhile I found a way (thank to @eliperelman) to do this with help of the chainWebpack inside my vue.config.js:

chainWebpack: config => {
    config
        .when(process.env.NODE_ENV === 'production', plugin => {
            plugin.plugin('extract-css').tap(([options, ...args]) => [
                Object.assign({}, options, { filename: 'Css/[name].css' }),
                ...args
            ])
        })
},

@xxxxxMiss
Copy link

@mediaessenz How to use the options.publicPath of extractCss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants