Skip to content

Side effect imports should make asset modules as not side effect free #20515

@alexander-akait

Description

@alexander-akait

Just a heads up: this broke our build. We marked fonts to include in the build with side-effect only imports from our code

import "~/assets/my-font.woff"

and as expected, this caused the font not to be copied anymore.

I think there should be extra documentation in https://webpack.js.org/guides/asset-modules mentionning this can be forced using

      {
        test: /\.(woff|woff2)$/,
        generator: {
          filename: 'fonts/[name][ext]',
        },
        type: 'asset/resource',
        sideEffects: true,
      },

Originally posted by @GerkinDev in #20352 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions