neo.mjs 4.0.29 → 4.0.32
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/buildScripts/buildAll.mjs +10 -0
- package/buildScripts/webpack/development/webpack.config.appworker.mjs +3 -7
- package/buildScripts/webpack/development/webpack.config.main.mjs +22 -3
- package/buildScripts/webpack/production/webpack.config.appworker.mjs +3 -7
- package/buildScripts/webpack/production/webpack.config.main.mjs +22 -3
- package/package.json +1 -1
|
@@ -128,6 +128,16 @@ if (programOpts.info) {
|
|
|
128
128
|
threads === 'yes' && spawnSync('node', [`${webpackPath}/buildThreads.mjs`] .concat(cpArgs), cpOpts);
|
|
129
129
|
parsedocs === 'yes' && spawnSync(npmCmd, ['run', 'generate-docs-json'], cpOpts);
|
|
130
130
|
|
|
131
|
+
if (env === 'all' || env === 'dev') {
|
|
132
|
+
spawnSync('node', [`${neoPath}/buildScripts/copyFolder.mjs -s ${path.resolve(cwd, 'docs/output') } -t ${path.resolve(cwd, 'dist/development/docs/output')}`], cpOpts);
|
|
133
|
+
spawnSync('node', [`${neoPath}/buildScripts/copyFolder.mjs -s ${path.resolve(cwd, 'docs/resources')} -t ${path.resolve(cwd, 'dist/development/docs/resources')}`], cpOpts);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (env === 'all' || env === 'prod') {
|
|
137
|
+
spawnSync('node', [`${neoPath}/buildScripts/copyFolder.mjs -s ${path.resolve(cwd, 'docs/output') } -t ${path.resolve(cwd, 'dist/production/docs/output')}`], cpOpts);
|
|
138
|
+
spawnSync('node', [`${neoPath}/buildScripts/copyFolder.mjs -s ${path.resolve(cwd, 'docs/resources')} -t ${path.resolve(cwd, 'dist/production/docs/resources')}`], cpOpts);
|
|
139
|
+
}
|
|
140
|
+
|
|
131
141
|
const processTime = (Math.round((new Date - startDate) * 100) / 100000).toFixed(2);
|
|
132
142
|
console.log(`\nTotal time for ${programName}: ${processTime}s`);
|
|
133
143
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import fs
|
|
2
|
-
import path
|
|
3
|
-
import webpack
|
|
4
|
-
import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import webpack from 'webpack';
|
|
5
4
|
|
|
6
5
|
const cwd = process.cwd(),
|
|
7
6
|
configPath = path.resolve(cwd, 'buildScripts/myApps.json'),
|
|
@@ -135,9 +134,6 @@ export default env => {
|
|
|
135
134
|
context.request = '../../' + context.request;
|
|
136
135
|
}
|
|
137
136
|
}),
|
|
138
|
-
new WebpackHookPlugin({
|
|
139
|
-
onBuildEnd: ['node '+path.resolve(neoPath, 'buildScripts/copyFolder.mjs')+' -s '+path.resolve(neoPath, 'docs/resources')+' -t '+path.resolve(cwd, buildTarget.folder, 'docs/resources')]
|
|
140
|
-
}),
|
|
141
137
|
...plugins
|
|
142
138
|
],
|
|
143
139
|
|
|
@@ -5,13 +5,31 @@ import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
|
5
5
|
const cwd = process.cwd(),
|
|
6
6
|
requireJson = path => JSON.parse(fs.readFileSync((path))),
|
|
7
7
|
packageJson = requireJson(path.resolve(cwd, 'package.json')),
|
|
8
|
-
|
|
8
|
+
insideNeo = packageJson.name === 'neo.mjs',
|
|
9
|
+
neoPath = insideNeo ? './' : './node_modules/neo.mjs/',
|
|
9
10
|
buildTarget = requireJson(path.resolve(neoPath, 'buildScripts/webpack/development/buildTarget.json')),
|
|
10
11
|
filenameConfig = requireJson(path.resolve(neoPath, 'buildScripts/webpack/json/build.json')),
|
|
11
12
|
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)},
|
|
12
13
|
copyFolder = path.resolve(neoPath, 'buildScripts/copyFolder.mjs'),
|
|
13
14
|
faFrom = path.resolve(cwd, 'node_modules/@fortawesome/fontawesome-free'),
|
|
14
|
-
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free')
|
|
15
|
+
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free'),
|
|
16
|
+
plugins = [];
|
|
17
|
+
|
|
18
|
+
if (!insideNeo) {
|
|
19
|
+
let resourcesPath = path.resolve(cwd, 'resources'),
|
|
20
|
+
itemPath, target;
|
|
21
|
+
|
|
22
|
+
fs.readdirSync(resourcesPath).forEach(itemName => {
|
|
23
|
+
itemPath = path.resolve(resourcesPath, itemName);
|
|
24
|
+
|
|
25
|
+
if (!fs.lstatSync(itemPath).isFile() && itemName !== 'scss') {
|
|
26
|
+
target = path.resolve(cwd, buildTarget.folder, 'resources', itemName);
|
|
27
|
+
|
|
28
|
+
fs.mkdirpSync(target);
|
|
29
|
+
fs.copySync(path.join(resourcesPath, itemName), target);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
15
33
|
|
|
16
34
|
export default {
|
|
17
35
|
mode : 'development',
|
|
@@ -22,7 +40,8 @@ export default {
|
|
|
22
40
|
plugins: [
|
|
23
41
|
new WebpackHookPlugin({
|
|
24
42
|
onBuildEnd: [`node ${copyFolder} -s ${faFrom} -t ${faTo}`]
|
|
25
|
-
})
|
|
43
|
+
}),
|
|
44
|
+
...plugins
|
|
26
45
|
],
|
|
27
46
|
|
|
28
47
|
output: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import fs
|
|
2
|
-
import path
|
|
3
|
-
import webpack
|
|
4
|
-
import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import webpack from 'webpack';
|
|
5
4
|
|
|
6
5
|
const cwd = process.cwd(),
|
|
7
6
|
configPath = path.resolve(cwd, 'buildScripts/myApps.json'),
|
|
@@ -139,9 +138,6 @@ export default env => {
|
|
|
139
138
|
context.request = '../../' + context.request;
|
|
140
139
|
}
|
|
141
140
|
}),
|
|
142
|
-
new WebpackHookPlugin({
|
|
143
|
-
onBuildEnd: ['node '+path.resolve(neoPath, 'buildScripts/copyFolder.mjs')+' -s '+path.resolve(neoPath, 'docs/resources')+' -t '+path.resolve(cwd, buildTarget.folder, 'docs/resources')]
|
|
144
|
-
}),
|
|
145
141
|
...plugins
|
|
146
142
|
],
|
|
147
143
|
|
|
@@ -5,13 +5,31 @@ import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
|
5
5
|
const cwd = process.cwd(),
|
|
6
6
|
requireJson = path => JSON.parse(fs.readFileSync((path))),
|
|
7
7
|
packageJson = requireJson(path.resolve(cwd, 'package.json')),
|
|
8
|
-
|
|
8
|
+
insideNeo = packageJson.name === 'neo.mjs',
|
|
9
|
+
neoPath = insideNeo ? './' : './node_modules/neo.mjs/',
|
|
9
10
|
buildTarget = requireJson(path.resolve(neoPath, 'buildScripts/webpack/production/buildTarget.json')),
|
|
10
11
|
filenameConfig = requireJson(path.resolve(neoPath, 'buildScripts/webpack/json/build.json')),
|
|
11
12
|
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)},
|
|
12
13
|
copyFolder = path.resolve(neoPath, 'buildScripts/copyFolder.mjs'),
|
|
13
14
|
faFrom = path.resolve(cwd, 'node_modules/@fortawesome/fontawesome-free'),
|
|
14
|
-
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free')
|
|
15
|
+
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free'),
|
|
16
|
+
plugins = [];
|
|
17
|
+
|
|
18
|
+
if (!insideNeo) {
|
|
19
|
+
let resourcesPath = path.resolve(cwd, 'resources'),
|
|
20
|
+
itemPath, target;
|
|
21
|
+
|
|
22
|
+
fs.readdirSync(resourcesPath).forEach(itemName => {
|
|
23
|
+
itemPath = path.resolve(resourcesPath, itemName);
|
|
24
|
+
|
|
25
|
+
if (!fs.lstatSync(itemPath).isFile() && itemName !== 'scss') {
|
|
26
|
+
target = path.resolve(cwd, buildTarget.folder, 'resources', itemName);
|
|
27
|
+
|
|
28
|
+
fs.mkdirpSync(target);
|
|
29
|
+
fs.copySync(path.join(resourcesPath, itemName), target);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
15
33
|
|
|
16
34
|
export default {
|
|
17
35
|
mode : 'production',
|
|
@@ -21,7 +39,8 @@ export default {
|
|
|
21
39
|
plugins: [
|
|
22
40
|
new WebpackHookPlugin({
|
|
23
41
|
onBuildEnd: [`node ${copyFolder} -s ${faFrom} -t ${faTo}`]
|
|
24
|
-
})
|
|
42
|
+
}),
|
|
43
|
+
...plugins
|
|
25
44
|
],
|
|
26
45
|
|
|
27
46
|
output: {
|