@pushwoosh/frontend-builder-engine 1.0.5 → 1.0.7
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/lib/pushwoosh-engine.js
CHANGED
|
@@ -15,6 +15,7 @@ program
|
|
|
15
15
|
.action(async () => {
|
|
16
16
|
const pushwooshConfig = loadPushwooshConfig();
|
|
17
17
|
const curDir = process.cwd();
|
|
18
|
+
const srcDir = `${curDir}/src`;
|
|
18
19
|
const targetDir = pushwooshConfig.libBuildTargetDir ?? `${curDir}/dist`;
|
|
19
20
|
const tsConfig = loadTsConfig({
|
|
20
21
|
compilerOptions: {
|
|
@@ -23,12 +24,13 @@ program
|
|
|
23
24
|
});
|
|
24
25
|
await buildTs(curDir, tsConfig);
|
|
25
26
|
await buildStyledComponents(targetDir, targetDir);
|
|
26
|
-
const
|
|
27
|
-
await Promise.all(
|
|
28
|
-
const sourcePath = `${
|
|
27
|
+
const svgFiles = await listFilesInDirectoryRecursively(srcDir).then((files) => files.filter((file) => file.endsWith('.svg')));
|
|
28
|
+
await Promise.all(svgFiles.map(async (file) => {
|
|
29
|
+
const sourcePath = `${srcDir}/${file}`;
|
|
29
30
|
const targetPath = `${targetDir}/${file}`;
|
|
30
31
|
await fs.mkdir(path.dirname(targetPath), { recursive: true });
|
|
31
32
|
await fs.copyFile(sourcePath, targetPath);
|
|
33
|
+
console.log(`Copied ${sourcePath} to ${targetPath}`);
|
|
32
34
|
}));
|
|
33
35
|
await fs.copyFile(`${curDir}/package.json`, `${targetDir}/package.json`);
|
|
34
36
|
await fs.copyFile(`${curDir}/.npmrc`, `${targetDir}/.npmrc`);
|
|
@@ -55,6 +55,18 @@ module.exports = (webpackConfigEnv, argv) => {
|
|
|
55
55
|
},
|
|
56
56
|
}),
|
|
57
57
|
],
|
|
58
|
+
module: {
|
|
59
|
+
rules: [
|
|
60
|
+
{
|
|
61
|
+
test: /\.svg$/,
|
|
62
|
+
type: 'asset/resource',
|
|
63
|
+
include: [
|
|
64
|
+
path.resolve(cwd, './node_modules/@pushwoosh/dumb-components'),
|
|
65
|
+
path.resolve(cwd, './node_modules/@pushwoosh/smart-components-kit')
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
58
70
|
};
|
|
59
71
|
if (!isProduction) {
|
|
60
72
|
extend.devServer = {
|