@shijiu/jsview-vue 0.9.273 → 0.9.274

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview-vue",
3
- "version": "0.9.273",
3
+ "version": "0.9.274",
4
4
  "bin": {
5
5
  "jsview-post-build": "./scripts/jsview-post-build.js",
6
6
  "jsview-post-install": "./scripts/jsview-post-install.js",
@@ -7,7 +7,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const compilerSfc = require("./compiler-sfc.cjs");
9
9
 
10
- var findCacheDir = _interopDefaultLegacy(require("find-cache-dir"));
11
10
  var fs = _interopDefaultLegacy(require('fs'));
12
11
  var hash = _interopDefaultLegacy(require('hash-sum'));
13
12
  var path = _interopDefaultLegacy(require('path'));
@@ -19,6 +18,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
19
18
 
20
19
  const adaptPath = (path.posix || path);
21
20
 
21
+ var nodeModulesDir = path.resolve(process.cwd(), 'node_modules')
22
22
  var cachedCssStyles = {}
23
23
 
24
24
  function ensureSfcDescriptor(descriptor) {
@@ -107,7 +107,7 @@ function compileCssToJs(sfc, options) {
107
107
  // styleCodeContainer.add(styleCode);
108
108
 
109
109
  checkSelectors(node, styleInfo.styleFilePath, styleInfo.styleSelectors); // 检测selector是否已经处理过
110
- styleImportContainer += `\nimport "${path.relative(process.cwd(), styleInfo.styleJsFilePath)}";`
110
+ styleImportContainer += `\nimport "${path.relative(nodeModulesDir, styleInfo.styleJsFilePath)}";`
111
111
  } else if(node.name === "keyframes") {
112
112
  const styleFilePath = node.source.input.file;
113
113
  const styleSelectors = new Set([node.params]);
@@ -219,7 +219,7 @@ function compileAndSaveImportedNode(styleFilePath, styleNodes) {
219
219
  })
220
220
 
221
221
  // 保存到js文件并import到script中
222
- const cacheDir = path.resolve(process.cwd(), 'node_modules', '@shijiu', '.cache')
222
+ const cacheDir = path.resolve(nodeModulesDir, '@shijiu', '.cache')
223
223
  if (!fs.existsSync(cacheDir)) {
224
224
  fs.mkdirSync(cacheDir);
225
225
  }