neo.mjs 4.0.29 → 4.0.30

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.
@@ -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
- neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
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 => {console.log(itemName);
23
+ itemPath = path.resolve(resourcesPath, itemName);
24
+
25
+ if (!isFile(itemPath) && 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: {
@@ -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
- neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
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 => {console.log(itemName);
23
+ itemPath = path.resolve(resourcesPath, itemName);
24
+
25
+ if (!isFile(itemPath) && 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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.29",
3
+ "version": "4.0.30",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {