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

Allow multiplie targets #46

Closed
wants to merge 4 commits into from
Closed

Allow multiplie targets #46

wants to merge 4 commits into from

Conversation

westtrade
Copy link

@westtrade westtrade commented Feb 22, 2017

Webpack can't use multiplie targets in one config https://webpack.js.org/concepts/targets/#multiple-targets, i think this patch can resolve this problem.

Example configuration

module.exports = {
    webpack(serverConfig, options) {
        const clientConfig = {
            target: 'web', // <=== can be omitted as default is 'web'
            entry: {
                client: ['src/client/index.js']
            },
            output: {
                path: 'build',
                filename: '[name].js',
                sourceMapFilename: '[name].map',
                publicPath: '/',
                libraryTarget: 'commonjs'
            }
        };

        return [serverConfig, clientConfig];
    }
};

Popov Gennadiy added 4 commits February 22, 2017 15:31
Webpack can't use multiplie targets in one config https://webpack.js.org/concepts/targets/#multiple-targets, i think this patch can resolve this problem.
@westtrade westtrade closed this Feb 22, 2017
@westtrade westtrade deleted the patch-1 branch February 22, 2017 17:38
@jaredpalmer
Copy link
Owner

this is a pretty cool idea

@Coriou
Copy link

Coriou commented Mar 16, 2018

Before finding this PR, I tried to do exactly this. My use case is I need a slightly special build for a cli "bin" and would have loved this to be supported

Any chance of seeing this one day ?

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

Successfully merging this pull request may close these issues.

3 participants