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

@dcasia/mini-program-tailwind-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcasia/mini-program-tailwind-webpack-plugin - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

39

dist/index.js

@@ -31,12 +31,18 @@ 'use strict';

var _a;
var FileType;
(function (FileType) {
FileType[FileType["Template"] = 0] = "Template";
FileType[FileType["Style"] = 1] = "Style";
})(FileType || (FileType = {}));
var _a, _b;
function isStyleFile(filename) {
return function (filename) { return /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(filename); };
return /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(filename);
}
function isTemplateFile(filename) {
return function (filename) { return /.+\.(wx|ax|jx|ks|tt|q)ml$/.test(filename); };
return /.+\.(wx|ax|jx|ks|tt|q)ml$/.test(filename);
}
var specialCharactersMap = (_a = {},
_a['['] = '_l_',
_a['\\'] = '_b_',
_a[']'] = '_r_',
_a['('] = '_p_',

@@ -48,8 +54,13 @@ _a[')'] = '_q_',

_a['.'] = '_d_',
_a['\\w:\\w'] = '_c_',
// eslint-disable-next-line no-useless-escape
_a['\w:\\w'] = '_c_',
_a);
function handleCharacters(content) {
var backslasheMap = (_b = {},
_b[FileType.Style] = '\\\\\\',
_b[FileType.Template] = '\\',
_b);
function handleCharacters(content, type) {
for (var from in specialCharactersMap) {
var to = specialCharactersMap[from];
var regExp = new RegExp("\\".concat(from), 'g');
var regExp = new RegExp(backslasheMap[type] + from, 'g');
/**

@@ -70,3 +81,3 @@ * Todo

if (node.type === 'rule') {
node.selector = handleCharacters(node.selector);
node.selector = handleCharacters(node.selector, FileType.Style);
}

@@ -88,3 +99,3 @@ });

if (node.attributes["class"]) {
node.attributes["class"] = handleCharacters(node.attributes["class"]);
node.attributes["class"] = handleCharacters(node.attributes["class"], FileType.Template);
}

@@ -116,10 +127,12 @@ }

var handledSource = '';
if (isStyleFile()) {
if (isStyleFile(pathname)) {
handledSource = handleStyle(rawSource);
}
else if (isTemplateFile()) {
else if (isTemplateFile(pathname)) {
handledSource = hanldeTemplate(rawSource);
}
var source = new ConcatSource(handledSource);
compilation.updateAsset(pathname, source);
if (handledSource) {
var source = new ConcatSource(handledSource);
compilation.updateAsset(pathname, source);
}
}

@@ -126,0 +139,0 @@ });

{
"name": "@dcasia/mini-program-tailwind-webpack-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

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

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