Skip to content

PostCSS not applied to CSS from CSS Modules composes #959

@privatenumber

Description

@privatenumber

Version

12.2.2

Reproduction link

https://github.com/hirokiosame/vue-loader-css-modules-postcss

Steps to reproduce

PostCSS doesn't seem to be getting applied to the files that CSS Modules pulls in via composes. This seems to be happening because vue-loader applies the postcss plugins as a module instead of a webpack plugin.

What is expected?

For PostCSS plugins to be applied to the files CSS Modules imports via composes.

What is actually happening?

PostCSS is not being applied to the files CSS Modules imports via composes

In my reproduction link, I have a repo that contains a vue init webpack build with very minor changes. It comes with autoprefixer installed to postcss and it should be getting applied to every file, however, this shows that it's not getting applied to the files imported via CSS Modules.
screen shot 2017-08-29 at 8 28 39 pm


This loader entry in my webpack config has been a temporary fix:

{
	test: /\.css$/,
	enforce: 'pre',
	loader: 'postcss-loader',
	include: [
		importedFilePath,
	],
},

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions