neo.mjs 4.0.40 → 4.0.41

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,12 +5,16 @@ import path from 'path';
5
5
  import postcss from 'postcss';
6
6
  import sass from 'sass';
7
7
 
8
- const cwd = process.cwd(),
9
- requireJson = path => JSON.parse(fs.readFileSync((path))),
10
- packageJson = requireJson(path.resolve(cwd, 'package.json')),
11
- neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
12
- mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
13
- scssPath = path.resolve(neoPath, 'resources/scss');
8
+ let cwd = process.cwd(),
9
+ requireJson = path => JSON.parse(fs.readFileSync((path))),
10
+ packageJson = requireJson(path.resolve(cwd, 'package.json')),
11
+ neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
12
+ mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
13
+ scssPath = path.resolve(cwd, 'resources/scss');
14
+
15
+ if (path.sep === '\\') {
16
+ mixinPath = mixinPath.replace(/\\/g, '/');
17
+ }
14
18
 
15
19
  fs.watch(scssPath, {
16
20
  recursive: true
@@ -28,7 +32,7 @@ function buildFile(filename) {
28
32
  console.log('start processing', filename);
29
33
 
30
34
  let filePath = path.join(scssPath, filename),
31
- destPath = path.join(neoPath, 'dist/development/css', filename.replace('.scss', '.css')),
35
+ destPath = path.join(cwd, 'dist/development/css', filename.replace('.scss', '.css')),
32
36
  startDate = new Date(),
33
37
  data, map;
34
38
 
@@ -54,13 +58,19 @@ function buildFile(filename) {
54
58
  // https://github.com/neomjs/neo/issues/1970
55
59
  map = JSON.parse(map);
56
60
 
57
- let len = filename.split('/').length,
58
- src = `/scss/${filename}`,
59
- i = 0;
61
+ let filenameSlash = filename;
60
62
 
63
+ if (path.sep === '\\') {
64
+ filenameSlash = filenameSlash.replace(/\\/g, '/');
65
+ }
66
+
67
+ let len = filenameSlash.split('/').length,
68
+ src = `/scss/${filenameSlash}`,
69
+ i = 0;
70
+
61
71
  for (; i < len; i++) {
62
72
  src = '../' + src;
63
- }
73
+ }
64
74
 
65
75
  map.sources = [src];
66
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.40",
3
+ "version": "4.0.41",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {