Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-modules-typescript-loader

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-modules-typescript-loader - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

index.js

@@ -66,3 +66,3 @@ const fs = require('fs');

const keyRegex = /"([^\\"]+)":/g;
const keyRegex = /"([^\\"]+)":\s*"(?:[^\\"]+)",?$/gm;
let match;

@@ -69,0 +69,0 @@ const cssModuleKeys = [];

{
"name": "css-modules-typescript-loader",
"version": "2.0.0",
"version": "2.0.1",
"description": "Webpack loader to create TypeScript declarations for CSS Modules",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,2 +6,3 @@ const path = require('path');

module.exports = (entry, options = {}) => {
const { sourceMap, ...loaderOptions } = options;
const compiler = webpack({

@@ -21,3 +22,3 @@ context: path.dirname(entry),

loader: require.resolve('../index.js'),
options
options: loaderOptions
},

@@ -27,3 +28,4 @@ {

options: {
modules: true
modules: true,
sourceMap: !!sourceMap
}

@@ -30,0 +32,0 @@ }

const fs = require('fs');
const compiler = require('../compiler.js');
test('Can emit valid declaration', async () => {
test('Can emit valid declaration without sourceMaps', async () => {
await compiler(require.resolve('./index.js'));

@@ -14,1 +14,24 @@

});
test('Can emit valid declaration with sourceMap', async () => {
await compiler(require.resolve('./index.js'), { sourceMap: true });
const declaration = fs.readFileSync(
require.resolve('./index.css.d.ts'),
'utf-8'
);
expect(declaration).toMatchInlineSnapshot(`
"// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'otherClass': string;
'someClass': string;
'validClass': string;
}
declare var cssExports: CssExports;
export = cssExports;
"
`);
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc