@pi-r/sass 0.7.3 → 0.8.0

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +6 -5
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ### @pi-r/sass
2
2
 
3
- https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html
3
+ https://e-mc.readthedocs.io/en/latest/document/plugins
4
4
 
5
5
  ### LICENSE
6
6
 
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const path = require("path");
3
3
  const url = require("url");
4
- module.exports = function transform(context, value, options) {
4
+ function transform(context, value, options) {
5
5
  context = options.upgrade(context, __dirname);
6
6
  const { sourceFile, sourceName, sourcesRelativeTo, sourceMap } = options;
7
7
  const baseConfig = options.toBaseConfig();
@@ -15,7 +15,7 @@ module.exports = function transform(context, value, options) {
15
15
  if (sourcesRelativeTo && !includePaths.includes(sourcesRelativeTo)) {
16
16
  includePaths.push(sourcesRelativeTo);
17
17
  }
18
- if (includePaths.length) {
18
+ if (includePaths.length > 0) {
19
19
  if (Array.isArray(baseConfig.loadPaths)) {
20
20
  baseConfig.loadPaths.push(...includePaths);
21
21
  }
@@ -23,13 +23,13 @@ module.exports = function transform(context, value, options) {
23
23
  baseConfig.loadPaths = includePaths;
24
24
  }
25
25
  }
26
- const result = context.compileString(value, baseConfig);
26
+ const result = context.initCompiler().compileString(value, baseConfig);
27
27
  if (result) {
28
28
  if (result.sourceMap) {
29
29
  sourceMap.nextMap('sass', result.css, result.sourceMap);
30
30
  }
31
31
  const loadedUrls = result.loadedUrls.map(item => url.fileURLToPath(item));
32
- if (loadedUrls.length) {
32
+ if (loadedUrls.length > 0) {
33
33
  const targetFile = sourcesRelativeTo && sourceName ? path.join(sourcesRelativeTo, sourceName) : '';
34
34
  if (targetFile) {
35
35
  loadedUrls.unshift(targetFile);
@@ -39,4 +39,5 @@ module.exports = function transform(context, value, options) {
39
39
  }
40
40
  return result.css;
41
41
  }
42
- };
42
+ }
43
+ module.exports = transform;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pi-r/sass",
3
- "version": "0.7.3",
4
- "description": "sass transform function for E-mc.",
3
+ "version": "0.8.0",
4
+ "description": "Sass transform function for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/anpham6/pi-r.git",
12
- "directory": "src/documemt/sass"
12
+ "directory": "src/document/sass"
13
13
  },
14
14
  "keywords": [
15
15
  "squared",