Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

How to add this in Webpack 4 ? #2

@igorhara

Description

@igorhara

I am trying to configure this module in a react project after ejecting, but I am unable to make it work. When I add it in the getStyleLoaders after the css-loader, it gives an error:

`./node_modules/bootstrap/dist/css/bootstrap.min.css (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/react-web-component-style-loader??ref--6-oneOf-3-2!./node_modules/postcss-loader/src??postcss!./node_modules/bootstrap/dist/css/bootstrap.min.css)
Unknown word (5:1)

3 | // load the styles
4 | var content = require("!!../../../postcss-loader/src/index.js??postcss!./bootstrap.min.css");

5 | if(typeof content === 'string') content = [[module.id, content, '']];
| ^
6 | // Prepare cssTransformation
7 | var transform;
8 |`

I tried to add like this:
const getStyleLoaders = (cssOptions, preProcessor) => { const loaders = [ require.resolve('style-loader'), { loader: require.resolve('css-loader'), options: cssOptions, }, { loader: require.resolve('react-web-component-style-loader'), options: cssOptions, },
and like this:
{ test: cssRegex, exclude: cssModuleRegex, use: getStyleLoaders({ importLoaders: 1,'react-web-component-style-loader' }), },

All goes to the same error above mentioned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions