Skip to content

After updating to css-loader 4 the d.ts file is empty #16

Closed
@jens-duttke

Description

@jens-duttke

I've updated to the css-loader from version 3 to verson 4, and after building the project, all my styles.d.ts files are empty (only containing the banner):

My configuration:

{
	test: /\.module\.scss$/u,
	use: [
		devMode ? 'style-loader' : {
			loader: MiniCssExtractPlugin.loader,
			options: {
				publicPath: '/', // CDN path here
				hmr: devMode
			}
		},
		{
			loader: 'dts-css-modules-loader',
			options: {
				namedExport: true,
				banner: '// This file is automatically generated. Do not modify this file manually -- YOUR CHANGES WILL BE ERASED!'
			}
		},
		{
			loader: 'css-loader',
			options: {
				modules: {
					localIdentName: '[local]__[hash:base62:5]', // Module scoped class name
					exportLocalsConvention: 'camelCaseOnly'
				},
				sourceMap: true
			}
		},
		{
			loader: 'postcss-loader',
			options: {
				sourceMap: true
			}
		},
		{
			loader: 'sass-loader',
			options: {
				sassOptions: {
					outputStyle: 'expanded'
				}
			}
		}
	]
},

A styles.d.ts file before the update:

// This file is automatically generated. Do not modify this file manually -- YOUR CHANGES WILL BE ERASED!
export const dialog: string;
export const content: string;
export const title: string;

And after the update:

// This file is automatically generated. Do not modify this file manually -- YOUR CHANGES WILL BE ERASED!

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