neo.mjs 4.0.24 → 4.0.27
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.
|
@@ -192,7 +192,7 @@ if (programOpts.info) {
|
|
|
192
192
|
} else {
|
|
193
193
|
fileInfo = path.parse(file);
|
|
194
194
|
|
|
195
|
-
if (!fileInfo.name.startsWith('_')) {
|
|
195
|
+
if (!fileInfo.name.startsWith('_') && fileInfo.ext === '.scss') {
|
|
196
196
|
className = relativePath === '' ? fileInfo.name : `${relativePath.substring(1)}/${fileInfo.name}`;
|
|
197
197
|
className = className.split('/').join('.');
|
|
198
198
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import fs
|
|
2
|
-
import path
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
3
4
|
|
|
4
5
|
const cwd = process.cwd(),
|
|
5
6
|
requireJson = path => JSON.parse(fs.readFileSync((path))),
|
|
@@ -7,7 +8,10 @@ const cwd = process.cwd(),
|
|
|
7
8
|
neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
|
|
8
9
|
buildTarget = requireJson(path.resolve(neoPath, 'buildScripts/webpack/development/buildTarget.json')),
|
|
9
10
|
filenameConfig = requireJson(path.resolve(neoPath, 'buildScripts/webpack/json/build.json')),
|
|
10
|
-
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)}
|
|
11
|
+
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)},
|
|
12
|
+
copyFolder = path.resolve(neoPath, 'buildScripts/copyFolder.mjs'),
|
|
13
|
+
faFrom = path.resolve(cwd, 'node_modules/@fortawesome/fontawesome-free'),
|
|
14
|
+
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free');
|
|
11
15
|
|
|
12
16
|
export default {
|
|
13
17
|
mode : 'development',
|
|
@@ -15,6 +19,12 @@ export default {
|
|
|
15
19
|
entry,
|
|
16
20
|
target : 'web',
|
|
17
21
|
|
|
22
|
+
plugins: [
|
|
23
|
+
new WebpackHookPlugin({
|
|
24
|
+
onBuildEnd: [`node ${copyFolder} -s ${faFrom} -t ${faTo}`]
|
|
25
|
+
})
|
|
26
|
+
],
|
|
27
|
+
|
|
18
28
|
output: {
|
|
19
29
|
chunkFilename: 'chunks/main/[id].js',
|
|
20
30
|
filename : filenameConfig.mainOutput,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import fs
|
|
2
|
-
import path
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import WebpackHookPlugin from 'webpack-hook-plugin';
|
|
3
4
|
|
|
4
5
|
const cwd = process.cwd(),
|
|
5
6
|
requireJson = path => JSON.parse(fs.readFileSync((path))),
|
|
@@ -7,13 +8,22 @@ const cwd = process.cwd(),
|
|
|
7
8
|
neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
|
|
8
9
|
buildTarget = requireJson(path.resolve(neoPath, 'buildScripts/webpack/production/buildTarget.json')),
|
|
9
10
|
filenameConfig = requireJson(path.resolve(neoPath, 'buildScripts/webpack/json/build.json')),
|
|
10
|
-
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)}
|
|
11
|
+
entry = {main: path.resolve(neoPath, filenameConfig.mainInput)},
|
|
12
|
+
copyFolder = path.resolve(neoPath, 'buildScripts/copyFolder.mjs'),
|
|
13
|
+
faFrom = path.resolve(cwd, 'node_modules/@fortawesome/fontawesome-free'),
|
|
14
|
+
faTo = path.resolve(cwd, buildTarget.folder, 'resources/fontawesome-free');
|
|
11
15
|
|
|
12
16
|
export default {
|
|
13
17
|
mode : 'production',
|
|
14
18
|
entry,
|
|
15
19
|
target: 'web',
|
|
16
20
|
|
|
21
|
+
plugins: [
|
|
22
|
+
new WebpackHookPlugin({
|
|
23
|
+
onBuildEnd: [`node ${copyFolder} -s ${faFrom} -t ${faTo}`]
|
|
24
|
+
})
|
|
25
|
+
],
|
|
26
|
+
|
|
17
27
|
output: {
|
|
18
28
|
chunkFilename: 'chunks/main/[id].js',
|
|
19
29
|
filename : filenameConfig.mainOutput,
|
package/package.json
CHANGED
|
@@ -47,11 +47,20 @@ class Stylesheet extends Base {
|
|
|
47
47
|
construct(config) {
|
|
48
48
|
super.construct(config);
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
let neoConfig = Neo.config,
|
|
51
|
+
faPath;
|
|
52
|
+
|
|
53
|
+
if (neoConfig.useFontAwesome) {
|
|
54
|
+
if (neoConfig.env === 'development') {
|
|
55
|
+
faPath = neoConfig.basePath + 'node_modules/@fortawesome/fontawesome-free/css/all.min.css';
|
|
56
|
+
} else {
|
|
57
|
+
faPath = neoConfig.basePath.substr(6) + 'resources/fontawesome-free/css/all.min.css';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
this.createStyleSheet(null, null, faPath);
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
if (
|
|
63
|
+
if (neoConfig.themes.length > 0 && neoConfig.themes[0] !== '') {
|
|
55
64
|
this.addGlobalCss();
|
|
56
65
|
}
|
|
57
66
|
}
|
|
@@ -60,11 +69,12 @@ class Stylesheet extends Base {
|
|
|
60
69
|
*
|
|
61
70
|
*/
|
|
62
71
|
addGlobalCss() {
|
|
63
|
-
let config
|
|
64
|
-
themes
|
|
65
|
-
folders
|
|
66
|
-
env
|
|
67
|
-
path
|
|
72
|
+
let config = Neo.config,
|
|
73
|
+
themes = config.themes,
|
|
74
|
+
folders = config.useCssVars ? ['src', ...themes] : [themes[0]],
|
|
75
|
+
env = config.environment,
|
|
76
|
+
path = env.startsWith('dist/') ? '' : `../../dist/${env}/`,
|
|
77
|
+
rootPath = config.basePath.substr(6);
|
|
68
78
|
|
|
69
79
|
document.body.classList.add(themes[0]);
|
|
70
80
|
|
|
@@ -76,7 +86,7 @@ class Stylesheet extends Base {
|
|
|
76
86
|
this.createStyleSheet(
|
|
77
87
|
null,
|
|
78
88
|
null,
|
|
79
|
-
`${
|
|
89
|
+
`${rootPath}${path}css${config.useCssVars ? '' : '-no-vars'}/${folder}/Global.css`
|
|
80
90
|
);
|
|
81
91
|
});
|
|
82
92
|
}
|