@changke/staticnext-build 0.3.2 → 0.3.4
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/CHANGELOG.md +11 -1
- package/lib/config.mjs +11 -7
- package/lib/vars.mjs +4 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## 0.3.
|
|
7
|
+
## 0.3.4
|
|
8
|
+
2023-07-15
|
|
9
|
+
### Changed
|
|
10
|
+
- Dependency updates
|
|
11
|
+
|
|
12
|
+
## 0.3.3
|
|
13
|
+
2023-07-10
|
|
14
|
+
### Fixed
|
|
15
|
+
- Exception if additional copy targets not provided
|
|
16
|
+
|
|
17
|
+
## 0.3.0 - 0.3.2
|
|
8
18
|
2023-07-09
|
|
9
19
|
### Added
|
|
10
20
|
- Support additional "source/target" pairs in `copy` task
|
package/lib/config.mjs
CHANGED
|
@@ -88,13 +88,17 @@ class Config {
|
|
|
88
88
|
* @param {boolean} appendSourcePath
|
|
89
89
|
*/
|
|
90
90
|
getCopyPairs = (copyPairs, sourceBase, targetBase, appendSourcePath = false) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if (copyPairs && Array.isArray(copyPairs) && copyPairs.length > 0) {
|
|
92
|
+
return copyPairs.map(pr => {
|
|
93
|
+
if (appendSourcePath) {
|
|
94
|
+
pr.sources = `${appendSourcePath}${pr.sources}`;
|
|
95
|
+
}
|
|
96
|
+
pr.target = `${targetBase}${pr.target}`;
|
|
97
|
+
return pr;
|
|
98
|
+
});
|
|
99
|
+
} else {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
98
102
|
};
|
|
99
103
|
}
|
|
100
104
|
|
package/lib/vars.mjs
CHANGED
|
@@ -45,6 +45,8 @@ const njkGlobals = {
|
|
|
45
45
|
'assetsUrlPath': assetsUrlPath
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
const copyPairs = [];
|
|
49
|
+
|
|
48
50
|
/** @type {SNConfig} */
|
|
49
51
|
const config = {
|
|
50
52
|
sourceRoot,
|
|
@@ -57,7 +59,8 @@ const config = {
|
|
|
57
59
|
mainEntryFile,
|
|
58
60
|
assetsUrlPath,
|
|
59
61
|
markdownEnabled,
|
|
60
|
-
njkGlobals
|
|
62
|
+
njkGlobals,
|
|
63
|
+
copyPairs
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@changke/staticnext-build",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Build scripts extracted from StaticNext seed project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"eslint": "^8.
|
|
22
|
+
"eslint": "^8.45.0",
|
|
23
23
|
"mocha": "^10.2.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"cpy": "^10.1.0",
|
|
27
27
|
"del": "^7.0.0",
|
|
28
|
-
"esbuild": "^0.18.
|
|
28
|
+
"esbuild": "^0.18.13",
|
|
29
29
|
"globby": "^13.2.2",
|
|
30
30
|
"highlight.js": "^11.8.0",
|
|
31
31
|
"marked": "^5.1.1",
|