Skip to content

webpack.config.js in webpack 5 #46

Open
@Hedaozi

Description

@Hedaozi

I am trying to use this package. However, it doesn't work.

Could you please teach me how to write webpack.config.js in webpack 5?

This is my webpack.config.js:

module: {
    strictExportPresence: true,
    rules: [
        // Handle node_modules packages that contain sourcemaps
        shouldUseSourceMap && {
            enforce: 'pre',
            exclude: /@babel(?:\/|\\{1,2})runtime/,
            test: /\.(js|mjs|jsx|ts|tsx|css)$/,
            loader: require.resolve('source-map-loader'),
        },
        {
            // "oneOf" will traverse all following loaders until one will
            // match the requirements. When no loader matches it will fall
            // back to the "file" loader at the end of the loader list.
            oneOf: [
                // Markdown
                {
                    test: /\.md$/,
                    use: [
                        {
                            loader: 'babel!react-markdown',
                        },
                    ],
                },
            ]
        },
    ],
}

version of webpack: 5.64.4

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