Skip to content

Mark files to be code split #21

@ScriptedAlchemy

Description

@ScriptedAlchemy

Right now, I can use externalize magic comment to provide a human-readable module name. However, marking a file to for a human-readable module name does not split that marked file out into a chunk.

Current Scenario

Website A

In order to ensure that website A provides me with an independent chunk, I do the following import(/* webpackChunkName: "hello-world"*/ './components/hello-world')

This leverages standard Webpack functionality and ensures that I end up with a hello-world.js file, which can be consumed independently inside Website B.

The goal

I don't want to be forced to code split a file using import(), if a file is marked to be externalized, then webpack should automatically chunk that file out on its own.

After some research, I have found a plugin which allows for modifying how the assets are chunked out and grouped together. A good starting place would be to look at how this is done in this plugin and extract the main mechanism used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions