Socket
Socket
Sign inDemoInstall

mini-css-extract-plugin

Package Overview
Dependencies
291
Maintainers
7
Versions
77
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.4.0

32

dist/index.js

@@ -32,2 +32,6 @@ 'use strict';

const REGEXP_CHUNKHASH = /\[chunkhash(?::(\d+))?\]/i;
const REGEXP_CONTENTHASH = /\[contenthash(?::(\d+))?\]/i;
const REGEXP_NAME = /\[name\]/i;
class CssDependency extends _webpack2.default.Dependency {

@@ -84,2 +88,12 @@ constructor({ identifier, content, media, sourceMap }, context, identifierIndex) {

updateCacheModule(module) {
this.content = module.content;
this.media = module.media;
this.sourceMap = module.sourceMap;
}
needRebuild() {
return true;
}
build(options, compilation, resolver, fileSystem, callback) {

@@ -154,3 +168,4 @@ this.buildInfo = {};

},
identifier: `mini-css-extract-plugin.${chunk.id}`
identifier: `mini-css-extract-plugin.${chunk.id}`,
hash: chunk.contentHash[NS]
});

@@ -169,6 +184,19 @@ }

},
identifier: `mini-css-extract-plugin.${chunk.id}`
identifier: `mini-css-extract-plugin.${chunk.id}`,
hash: chunk.contentHash[NS]
});
}
});
compilation.mainTemplate.hooks.hashForChunk.tap(pluginName, (hash, chunk) => {
const { chunkFilename } = this.options;
if (REGEXP_CHUNKHASH.test(chunkFilename)) {
hash.update(JSON.stringify(chunk.getChunkMaps(true).hash));
}
if (REGEXP_CONTENTHASH.test(chunkFilename)) {
hash.update(JSON.stringify(chunk.getChunkMaps(true).contentHash[NS] || {}));
}
if (REGEXP_NAME.test(chunkFilename)) {
hash.update(JSON.stringify(chunk.getChunkMaps(true).name));
}
});
compilation.hooks.contentHash.tap(pluginName, chunk => {

@@ -175,0 +203,0 @@ const { outputOptions } = compilation;

6

package.json
{
"name": "mini-css-extract-plugin",
"version": "0.3.0",
"version": "0.4.0",
"description": "desc",

@@ -47,3 +47,3 @@ "main": "dist/cjs.js",

"standard-version": "^4.3.0",
"webpack": "^4.3.0",
"webpack": "^4.4.0",
"webpack-cli": "^2.0.13",

@@ -60,3 +60,3 @@ "webpack-defaults": "^1.6.0",

"peerDependencies": {
"webpack": "^4.3.0"
"webpack": "^4.4.0"
},

@@ -63,0 +63,0 @@ "pre-commit": "lint-staged",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc