Skip to content
This repository was archived by the owner on Dec 25, 2018. It is now read-only.

Support for React (typescript) with inline CSS, is this possible? #133

Open
sandrocsimas opened this issue May 9, 2018 · 1 comment
Open

Comments

@sandrocsimas
Copy link

sandrocsimas commented May 9, 2018

I have a React project (typescript) that bundles to a single JS file including everything. PurifyCSS webpack plugin is not working as expected.
The following is the relevant code of my Webpack config:

{
  test: /\.less$/,
  use: [
    'style-loader',
    {
      loader: 'css-loader',
      options: {
        minimize: env === 'production',
      },
    },
    'less-loader',
  ],
  include: helpers.root('/src/assets/styles'),
}
new PurifyCSSPlugin({
  paths: glob.sync(`${helpers.root('/src')}/**/*`),
  styleExtensions: ['.js', '.css', '.less'],
  moduleExtensions: ['.js'],
  verbose: true,
})

This project doesn't have HTML files, only Typescript and Less files.
How to use PurifyCSS in this case? This only works using ExtractTextPlugin?

@sandrocsimas sandrocsimas changed the title Support for React (typescript) with inline CSS, is it possible? Support for React (typescript) with inline CSS, is this possible? May 9, 2018
@sandrocsimas
Copy link
Author

It seems the plugin only read the output files. Is there a way to use it as a loader?
The purifycss should be applied after "css-loader" of "style-loader".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant