Giter Club home page Giter Club logo

Comments (6)

ScriptedAlchemy avatar ScriptedAlchemy commented on July 26, 2024

Do you have any custom split chunks set?

from universe.

lecion avatar lecion commented on July 26, 2024

This is my optimization config:

    optimization: {
        splitChunks: {
            chunks: 'all',
            minSize: 20000, // 20kb
            maxInitialRequests: 12,
            cacheGroups: {
                echarts: {
                    name: 'chunk-echarts',
                    chunks: 'async',
                    priority: 20,
                    test: /[\\/]node_modules[\\/]_?echarts|zrender(.*)/
                },
                abcUI: {
                    name: 'chunk-abcui',
                    chunks: 'all',
                    test: /[\\/]node_modules[\\/](@abc\/ui-pc)[\\/]/,
                    priority: 20,
                    reuseExistingChunk: true
                },
                lib: {
                    test(module) {
                        return (
                            module.size() > 160000 &&
                            /node_modules[/\\]/.test(module.nameForCondition() || '')
                        )
                    },
                    name(module) {
                        const packageNameArr = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/);
                        const packageName = packageNameArr ? packageNameArr[1] : '';
                        return `chunk-lib.${packageName.replace("@", "")}`;
                    },
                    priority: 15,
                    minChunks: 2,
                    reuseExistingChunk: true,
                },
                vendors: {
                    name: 'chunk-vendors',
                    test: /[\\/]node_modules[\\/]/,
                    priority: 10,
                    chunks: 'initial'
                },
                api: {
                    name: 'chunk-api',
                    test: /[\\/]src\/api[\\/]/,
                    minChunks: 3,
                    priority: 5,
                    reuseExistingChunk: true
                },
                commons: {
                    name: 'chunk-commons',
                    minChunks: 5, // minimum common number
                    priority: 0,
                    maxSize: 4000000,
                    reuseExistingChunk: true,
                },
            },
        },
        runtimeChunk: { name: 'runtime' },
    }

from universe.

2heal1 avatar 2heal1 commented on July 26, 2024

try to delete optimization. runtimeChunk

from universe.

ScriptedAlchemy avatar ScriptedAlchemy commented on July 26, 2024

yeah its most likely runtime chunk settings.

from universe.

lecion avatar lecion commented on July 26, 2024

@2heal1 @ScriptedAlchemy
Thank you for your help. I deleted the optimization.runtimeChunk option, and it works.
But it loses the optimization benefits. Is there a way to keep Module Federation and runtime chunk together?

from universe.

ScriptedAlchemy avatar ScriptedAlchemy commented on July 26, 2024

on federation plugin, set runtime: false - this will force a full runtime for container files

from universe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.