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.config.js in webpack 5 #46

Open
Hedaozi opened this issue Nov 22, 2022 · 0 comments
Open

webpack.config.js in webpack 5 #46

Hedaozi opened this issue Nov 22, 2022 · 0 comments

Comments

@Hedaozi
Copy link

Hedaozi commented Nov 22, 2022

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

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