neo.mjs 4.3.19 → 4.3.20
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.
@@ -13,7 +13,8 @@ const __dirname = path.resolve(),
|
|
13
13
|
cwd = process.cwd(),
|
14
14
|
requireJson = path => JSON.parse(fs.readFileSync((path))),
|
15
15
|
packageJson = requireJson(path.resolve(cwd, 'package.json')),
|
16
|
-
neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
|
16
|
+
neoPath = path.resolve(packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/'),
|
17
|
+
insideNeo = packageJson.name === 'neo.mjs',
|
17
18
|
programName = `${packageJson.name} buildThemes`,
|
18
19
|
program = new Command(),
|
19
20
|
regexComments = /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,
|
@@ -325,7 +326,7 @@ if (programOpts.info) {
|
|
325
326
|
|
326
327
|
fs.readFile(file.path).then(content => {
|
327
328
|
let result = sass.renderSync({
|
328
|
-
data : data + scssCombine(content.toString(), path.
|
329
|
+
data : data + scssCombine(content.toString(), path.join(neoPath, scssPath, target, file.relativePath)),
|
329
330
|
outFile : destPath,
|
330
331
|
sourceMap : devMode,
|
331
332
|
sourceMapEmbed: false
|
@@ -399,8 +400,12 @@ if (programOpts.info) {
|
|
399
400
|
function scssCombine (content, baseDir) {
|
400
401
|
if (regexSassImport.test(content)) {
|
401
402
|
content = content.replace(regexSassImport, (m, capture) => {
|
402
|
-
|
403
|
-
|
403
|
+
if (!insideNeo && capture.startsWith('../')) {
|
404
|
+
capture = '../../' + capture;
|
405
|
+
}
|
406
|
+
|
407
|
+
let parse = path.parse(path.join(baseDir, capture)),
|
408
|
+
file = path.join(`${parse.dir}/${parse.name}.scss`);
|
404
409
|
|
405
410
|
if (!fs.existsSync(file)) {
|
406
411
|
file = path.resolve(`${parse.dir}/_${parse.name}.scss`);
|