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

Working with custom Webpack config #278

Closed
maryschmidt opened this issue Oct 8, 2021 · 1 comment
Closed

Working with custom Webpack config #278

maryschmidt opened this issue Oct 8, 2021 · 1 comment

Comments

@maryschmidt
Copy link

Hi, I'm struggling to get this package building with a custom Webpack config. I saw somewhere that Webpack needs to be configured to load CSS from node_modules, but I can't seem to get that working. Could you give me any pointers?

const excludeCssPaths = [
    /node_modules\/(?!(@uiw\/react-md-editor|@uiw\/react-markdown-preview)\/).*/
];
     new MiniCssExtractPlugin({
            filename: '[name].[contenthash].css',
            chunkFilename: '[id].[contenthash].css',
        }),
                {
                    test: /\.(css|less)$/,
                    exclude: [...excludeCssPaths],
                    use: [
                        MiniCssExtractPlugin.loader,
                        {
                            loader: 'css-loader',
                            options: {
                                importLoaders: 2,
                            },
                        },
                        {
                            loader: 'postcss-loader',
                        },
                        {
                            loader: 'less-loader', 
                            options: {
                                lessOptions: {
                                    relativeUrls: false,
                                },
                            },
                        },
                    ],
                },
@maryschmidt
Copy link
Author

Nevermind.. Was foiled by a lurking test webpack config that I hadn't updated 🤦🏼‍♀️

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