chaincss 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +4 -1
- package/dist/compiler/index.js +4 -1
- package/dist/index.js +4 -1
- package/dist/plugins/vite.js +4 -1
- package/package.json +1 -1
- package/src/compiler/prefixer.ts +10 -4
package/dist/cli/index.js
CHANGED
|
@@ -1407,6 +1407,9 @@ ${rules}}
|
|
|
1407
1407
|
});
|
|
1408
1408
|
|
|
1409
1409
|
// src/compiler/prefixer.ts
|
|
1410
|
+
function __import__(name) {
|
|
1411
|
+
return new Function("name", "return import(name)")(name);
|
|
1412
|
+
}
|
|
1410
1413
|
async function loadPostcss() {
|
|
1411
1414
|
if (postcss) return postcss;
|
|
1412
1415
|
if (loadingPromises.has("postcss")) return loadingPromises.get("postcss");
|
|
@@ -1433,7 +1436,7 @@ async function loadAutoprefixer() {
|
|
|
1433
1436
|
const promise = (async () => {
|
|
1434
1437
|
if (!autoprefixerLoaded) {
|
|
1435
1438
|
try {
|
|
1436
|
-
const module =
|
|
1439
|
+
const module = __import__("autoprefixer");
|
|
1437
1440
|
autoprefixer = module.default || module;
|
|
1438
1441
|
} catch (err) {
|
|
1439
1442
|
if (process.env.DEBUG) {
|
package/dist/compiler/index.js
CHANGED
|
@@ -3980,6 +3980,9 @@ ${rules}}
|
|
|
3980
3980
|
|
|
3981
3981
|
// src/compiler/prefixer.ts
|
|
3982
3982
|
var postcss = null;
|
|
3983
|
+
function __import__(name) {
|
|
3984
|
+
return new Function("name", "return import(name)")(name);
|
|
3985
|
+
}
|
|
3983
3986
|
var autoprefixer = null;
|
|
3984
3987
|
var postcssLoaded = false;
|
|
3985
3988
|
var autoprefixerLoaded = false;
|
|
@@ -4010,7 +4013,7 @@ async function loadAutoprefixer() {
|
|
|
4010
4013
|
const promise = (async () => {
|
|
4011
4014
|
if (!autoprefixerLoaded) {
|
|
4012
4015
|
try {
|
|
4013
|
-
const module =
|
|
4016
|
+
const module = __import__("autoprefixer");
|
|
4014
4017
|
autoprefixer = module.default || module;
|
|
4015
4018
|
} catch (err) {
|
|
4016
4019
|
if (process.env.DEBUG) {
|
package/dist/index.js
CHANGED
|
@@ -4989,6 +4989,9 @@ ${rules}}
|
|
|
4989
4989
|
|
|
4990
4990
|
// src/compiler/prefixer.ts
|
|
4991
4991
|
var postcss = null;
|
|
4992
|
+
function __import__(name) {
|
|
4993
|
+
return new Function("name", "return import(name)")(name);
|
|
4994
|
+
}
|
|
4992
4995
|
var autoprefixer = null;
|
|
4993
4996
|
var postcssLoaded = false;
|
|
4994
4997
|
var autoprefixerLoaded = false;
|
|
@@ -5019,7 +5022,7 @@ async function loadAutoprefixer() {
|
|
|
5019
5022
|
const promise = (async () => {
|
|
5020
5023
|
if (!autoprefixerLoaded) {
|
|
5021
5024
|
try {
|
|
5022
|
-
const module2 =
|
|
5025
|
+
const module2 = __import__("autoprefixer");
|
|
5023
5026
|
autoprefixer = module2.default || module2;
|
|
5024
5027
|
} catch (err) {
|
|
5025
5028
|
if (process.env.DEBUG) {
|
package/dist/plugins/vite.js
CHANGED
|
@@ -1357,6 +1357,9 @@ ${rules}}
|
|
|
1357
1357
|
|
|
1358
1358
|
// src/compiler/prefixer.ts
|
|
1359
1359
|
var postcss = null;
|
|
1360
|
+
function __import__(name) {
|
|
1361
|
+
return new Function("name", "return import(name)")(name);
|
|
1362
|
+
}
|
|
1360
1363
|
var autoprefixer = null;
|
|
1361
1364
|
var postcssLoaded = false;
|
|
1362
1365
|
var autoprefixerLoaded = false;
|
|
@@ -1387,7 +1390,7 @@ async function loadAutoprefixer() {
|
|
|
1387
1390
|
const promise = (async () => {
|
|
1388
1391
|
if (!autoprefixerLoaded) {
|
|
1389
1392
|
try {
|
|
1390
|
-
const module =
|
|
1393
|
+
const module = __import__("autoprefixer");
|
|
1391
1394
|
autoprefixer = module.default || module;
|
|
1392
1395
|
} catch (err) {
|
|
1393
1396
|
if (process.env.DEBUG) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chaincss",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "ChainCSS v3.0 - The first CSS-in-JS library with true auto-detection mixed mode. Zero runtime by default, dynamic when you need it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/src/compiler/prefixer.ts
CHANGED
|
@@ -23,6 +23,12 @@ type Autoprefixer = any;
|
|
|
23
23
|
|
|
24
24
|
// Declare variables for optional dependencies (initially null)
|
|
25
25
|
let postcss: PostCSS | null = null;
|
|
26
|
+
|
|
27
|
+
// Helper to load optional deps without Vite static analysis
|
|
28
|
+
function __import__(name: string): Promise<any> {
|
|
29
|
+
return new Function("name", "return import(name)")(name);
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
let browserslist: Browserslist | null = null;
|
|
27
33
|
let caniuse: any = null;
|
|
28
34
|
let autoprefixer: Autoprefixer | null = null;
|
|
@@ -65,8 +71,8 @@ async function loadBrowserslist() {
|
|
|
65
71
|
const promise = (async () => {
|
|
66
72
|
if (!browserslistLoaded) {
|
|
67
73
|
try {
|
|
68
|
-
const module =
|
|
69
|
-
browserslist = module.default || module;
|
|
74
|
+
const module = __import__('browserslist');
|
|
75
|
+
browserslist = (module as any).default || module;
|
|
70
76
|
} catch (err) {
|
|
71
77
|
browserslist = null;
|
|
72
78
|
}
|
|
@@ -109,8 +115,8 @@ async function loadAutoprefixer() {
|
|
|
109
115
|
if (!autoprefixerLoaded) {
|
|
110
116
|
try {
|
|
111
117
|
// @ts-ignore - autoprefixer is optional
|
|
112
|
-
const module =
|
|
113
|
-
autoprefixer = module.default || module;
|
|
118
|
+
const module = __import__('autoprefixer');
|
|
119
|
+
autoprefixer = (module as any).default || module;
|
|
114
120
|
} catch (err) {
|
|
115
121
|
if (process.env.DEBUG) {
|
|
116
122
|
console.warn('autoprefixer not installed');
|