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

fixed single output only bug #212

Merged
merged 2 commits into from Aug 31, 2021
Merged

fixed single output only bug #212

merged 2 commits into from Aug 31, 2021

Conversation

azt3k
Copy link
Contributor

@azt3k azt3k commented Dec 4, 2018

hard coding a default of '[hash].js' for config.output.filename means that multiple outputs don't work.

@shama
Copy link
Owner

shama commented Dec 4, 2018

Hmm weird, can you post an example config for me to try?

@azt3k
Copy link
Contributor Author

azt3k commented Jan 27, 2019

const webpack = require('webpack');
const env = process.env.ENV || 'local';

module.exports = {
    mode: 'development',
    entry: {
        all: [
            'webpack/hot/dev-server?path=http://localhost:9000/__webpack_hmr',
            __dirname + '/app/client/js/index.js'
        ],
        'style-loader': [
            'webpack/hot/dev-server?path=http://localhost:9000/__webpack_hmr',
            __dirname + '/app/client/js/style-loader.js'
        ]
    },
    output: {
        path: __dirname + '/public/resources/js'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                use: {
                    loader: 'babel-loader?cacheDirectory=.tmp/' + env
                }
            },
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /\.(png|woff|woff2|eot|ttf|svg|gif)$/,
                use: {
                    loader: 'url-loader?limit=100000'
                }
            }
        ]
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
};

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.

None yet

2 participants