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

Webpack stuck at 'wait until bundle finished: /' #45

Open
WahidN opened this issue Nov 1, 2019 · 0 comments
Open

Webpack stuck at 'wait until bundle finished: /' #45

WahidN opened this issue Nov 1, 2019 · 0 comments

Comments

@WahidN
Copy link

WahidN commented Nov 1, 2019

I found the following issue:

When I try to start patternlab with patternlab: serve, my webpack is stuck at these two messages:

i 「wdm」: wait until bundle finished: /
i 「wdm」: wait until bundle finished: /sw.js

This is my webpack.app.js

const webpack = require("webpack");
const {
    getIfUtils
} = require("webpack-config-utils");
const {
    resolve
} = require("path");
const globby = require("globby");
const plConfig = require("../../patternlab-config.json");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = env => {
    const {
        ifProduction,
        ifDevelopment
    } = getIfUtils(env);
    const appNamespace = plConfig.app.namespace ?
        `$ns:${plConfig.app.namespace};` :
        ``;
    const app = {
        entry: {
            "css/styles": globby.sync(
                [
                    resolve(`${plConfig.paths.source.css}scss/*.scss`),
                ], {
                    gitignore: true
                }
            )
        },
        optimization: {
            splitChunks: {
                cacheGroups: {
                    vendor: {
                        test: /node_modules/,
                        chunks: "initial",
                        name: "css/sample-project-vendor",
                        priority: 10,
                        enforce: true
                    }
                }
            }
        },
        plugins: [
            new MiniCssExtractPlugin({
                filename: "[name].css",
                disable: ifDevelopment()
            }),
            new webpack.DefinePlugin({
                NAMESPACE: appNamespace
            })
        ],
        module: {
            rules: [{
                    test: /\.scss$/,
                    use: [{
                            loader: ifDevelopment(
                                "style-loader",
                                MiniCssExtractPlugin.loader
                            )

                        },
                        {
                            loader: "css-loader"
                        },
                        {
                            loader: "postcss-loader",
                            options: {
                                sourceMap: ifDevelopment(),
                                plugins: loader => [
                                    // eslint-disable-line no-unused-vars
                                    require("autoprefixer"),
                                    require("postcss-flexbugs-fixes")
                                ]
                            }
                        },
                        {
                            loader: "sass-loader",
                            options: {
                                sourceMap: ifDevelopment(),
                                sassOptions: {
                                    precision: 3,
                                    outputStyle: ifProduction(
                                        "compressed",
                                        "expanded"
                                    ),
                                    prependData: appNamespace
                                }
                            }
                        },
                        {
                            loader: "import-glob-loader"
                        }
                    ]
                },
                {
                    test: /\.(woff|woff2|ttf|otf)$/,
                    loader: 'file-loader',
                    include: [/fonts/],

                    options: {
                        name: '[hash].[ext]',
                        outputPath: 'css/',
                        publicPath: url => '../css/' + url
                    }
                },
                {
                    test: /\.(png|jp(e*)g|svg)$/,
                    use: [{
                        loader: 'url-loader',
                        options: {
                            limit: 8000, // Convert images < 8kb to base64 strings
                            name: 'images/[hash]-[name].[ext]'
                        }
                    }]
                }
            ]
        }
    };
    return app;
};

The 'patternlab:build' works fine

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

No branches or pull requests

1 participant