@atomicsmash/compiler 3.0.0-beta.3 → 3.0.0
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/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -47
- package/package.json +13 -15
package/dist/config.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export declare function config(options: {
|
|
|
128
128
|
oneOf?: undefined;
|
|
129
129
|
})[];
|
|
130
130
|
};
|
|
131
|
-
plugins: (BlocksPlugin | DependencyExtractionWebpackPlugin | CopyPlugin |
|
|
131
|
+
plugins: (BlocksPlugin | DependencyExtractionWebpackPlugin | CopyPlugin | import("vue-loader").VueLoaderPlugin | WebpackAssetsManifest | SVGSpritemapPlugin | BundleAnalyzerPlugin | webpack.DefinePlugin)[];
|
|
132
132
|
optimization: {
|
|
133
133
|
minimizer: EsbuildPlugin[];
|
|
134
134
|
};
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAiB,QAAQ,EAAe,MAAM,SAAS,CAAC;AAUpE,OAAO,iCAAiC,MAAM,iDAAiD,CAAC;AAEhG,OAAO,UAAU,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAiB,QAAQ,EAAe,MAAM,SAAS,CAAC;AAUpE,OAAO,iCAAiC,MAAM,iDAAiD,CAAC;AAEhG,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,wBAAsB,MAAM,CAAC,OAAO,EAAE;IACrC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAyM4B,QAAQ;;;;;;;;;;;;;;;qCAeV,QAAQ;;;;;;;;;;sCA7PA,CAAC;;;;;;;;;;;;;;;;;;;;;;;GA4bnC"}
|
package/dist/config.js
CHANGED
|
@@ -4,7 +4,6 @@ import { getSmashConfig } from "@atomicsmash/smash-config";
|
|
|
4
4
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
5
5
|
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
6
6
|
import CopyPlugin from "copy-webpack-plugin";
|
|
7
|
-
import { cosmiconfig } from "cosmiconfig";
|
|
8
7
|
import cssNano from "cssnano";
|
|
9
8
|
import { EsbuildPlugin } from "esbuild-loader";
|
|
10
9
|
import glob from "fast-glob";
|
|
@@ -320,6 +319,10 @@ export async function config(options) {
|
|
|
320
319
|
entry.key = "icons/sprite.svg";
|
|
321
320
|
return entry;
|
|
322
321
|
}
|
|
322
|
+
if (entry.key.startsWith("icons/sprite") && entry.key.endsWith(".svg")) {
|
|
323
|
+
entry.key = "icons/sprite.svg";
|
|
324
|
+
return entry;
|
|
325
|
+
}
|
|
323
326
|
if (entry.key.startsWith("/")) {
|
|
324
327
|
entry.key = entry.key.slice(1);
|
|
325
328
|
}
|
|
@@ -389,52 +392,25 @@ async function getSassOptions(srcFolder) {
|
|
|
389
392
|
if (smashConfig) {
|
|
390
393
|
return smashConfig.scssAliases;
|
|
391
394
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const config = result.config;
|
|
401
|
-
if (typeof config === "object" &&
|
|
402
|
-
config !== null &&
|
|
403
|
-
Object.keys(config).length <= 2) {
|
|
404
|
-
if (Object.keys(config).length === 2 &&
|
|
405
|
-
"importers" in config &&
|
|
406
|
-
"loadPaths" in config) {
|
|
407
|
-
return config;
|
|
408
|
-
}
|
|
409
|
-
if (Object.keys(config).length === 1 &&
|
|
410
|
-
("importers" in config || "loadPaths" in config)) {
|
|
411
|
-
return config;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
throw new Error("Return default config.");
|
|
415
|
-
})
|
|
416
|
-
.catch(() => {
|
|
417
|
-
const defaultConfig = {
|
|
418
|
-
importers: [
|
|
419
|
-
{
|
|
420
|
-
findFileUrl(url) {
|
|
421
|
-
if (!url.startsWith("sitecss:"))
|
|
422
|
-
return null;
|
|
423
|
-
const pathname = url.substring(8);
|
|
424
|
-
return pathToFileURL(`${resolvePath(srcFolder, "../css")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
425
|
-
},
|
|
395
|
+
const defaultConfig = {
|
|
396
|
+
importers: [
|
|
397
|
+
{
|
|
398
|
+
findFileUrl(url) {
|
|
399
|
+
if (!url.startsWith("sitecss:"))
|
|
400
|
+
return null;
|
|
401
|
+
const pathname = url.substring(8);
|
|
402
|
+
return pathToFileURL(`${resolvePath(srcFolder, "../css")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
426
403
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
findFileUrl(url) {
|
|
407
|
+
if (!url.startsWith("launchpad:"))
|
|
408
|
+
return null;
|
|
409
|
+
const pathname = url.substring(10);
|
|
410
|
+
return pathToFileURL(`${resolvePath(process.cwd(), "public/wp-content/themes/launchpad/src/styles")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
434
411
|
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return config;
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
};
|
|
415
|
+
return defaultConfig;
|
|
440
416
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "A universal compiler for all Atomic Smash projects.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@atomicsmash/date-php": "^2.1.0",
|
|
50
|
-
"@atomicsmash/smash-config": "^1.0.0
|
|
51
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
50
|
+
"@atomicsmash/smash-config": "^1.0.0",
|
|
51
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.36.0",
|
|
52
52
|
"browserslist-to-esbuild": "^2.1.1",
|
|
53
|
-
"copy-webpack-plugin": "^
|
|
54
|
-
"cosmiconfig": "^9.0.0",
|
|
53
|
+
"copy-webpack-plugin": "^13.0.1",
|
|
55
54
|
"cssnano": "^7.1.2",
|
|
56
55
|
"esbuild-loader": "^4.4.0",
|
|
57
56
|
"fast-glob": "^3.3.3",
|
|
@@ -59,20 +58,19 @@
|
|
|
59
58
|
"json2php": "^0.0.12",
|
|
60
59
|
"postcss": "^8.5.6",
|
|
61
60
|
"postcss-loader": "^8.2.0",
|
|
62
|
-
"postcss-preset-env": "^10.
|
|
63
|
-
"sass": "^1.
|
|
61
|
+
"postcss-preset-env": "^10.5.0",
|
|
62
|
+
"sass": "^1.97.0",
|
|
64
63
|
"sass-loader": "^16.0.6",
|
|
65
|
-
"svg-spritemap-webpack-plugin": "^
|
|
64
|
+
"svg-spritemap-webpack-plugin": "^5.1.0",
|
|
66
65
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
67
|
-
"tsx": "^4.
|
|
68
|
-
"webpack": "^5.
|
|
69
|
-
"webpack-assets-manifest": "^6.
|
|
70
|
-
"webpack-bundle-analyzer": "^
|
|
71
|
-
"yargs": "^
|
|
66
|
+
"tsx": "^4.21.0",
|
|
67
|
+
"webpack": "^5.104.0",
|
|
68
|
+
"webpack-assets-manifest": "^6.5.0",
|
|
69
|
+
"webpack-bundle-analyzer": "^5.1.0",
|
|
70
|
+
"yargs": "^18.0.0"
|
|
72
71
|
},
|
|
73
72
|
"devDependencies": {
|
|
74
|
-
"@tailwindcss/postcss": "^4.1.
|
|
75
|
-
"@types/svg-spritemap-webpack-plugin": "^4.4.4",
|
|
73
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
76
74
|
"@types/webpack": "^5.28.5",
|
|
77
75
|
"@types/webpack-assets-manifest": "^5.1.4",
|
|
78
76
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|