@shijiu/jsview-vue 0.9.272 → 0.9.273

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.272",
3
+ "version": "0.9.273",
4
4
  "bin": {
5
5
  "jsview-post-build": "./scripts/jsview-post-build.js",
6
6
  "jsview-post-install": "./scripts/jsview-post-install.js",
@@ -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 "${styleInfo.styleJsFilePath}";`
110
+ styleImportContainer += `\nimport "${path.relative(process.cwd(), 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]);
@@ -151,7 +151,7 @@ function checkSelectors(node, styleFilePath, styleSelectors) {
151
151
  const cachedSelectors = cachedCssStyles[cachedFilePath];
152
152
  for(let selector of cachedSelectors) {
153
153
  if(styleSelectors.has(selector)) { // 发现重复的selector
154
- let errMsg = "JsView Error: Multi defined CSS selector '" + selector + "' from " + node.source.input.file + ".\n";
154
+ let errMsg = "JsView Warn: Multi defined CSS selector '" + selector + "' from " + node.source.input.file + ".\n";
155
155
  errMsg += "It has been defined in " + cachedFilePath + ".\n";
156
156
  check(false, node.source.input.css, errMsg);
157
157
  }
@@ -219,9 +219,10 @@ function compileAndSaveImportedNode(styleFilePath, styleNodes) {
219
219
  })
220
220
 
221
221
  // 保存到js文件并import到script中
222
- const cacheDir = findCacheDir({
223
- name: 'jsview-dom', create: true
224
- });
222
+ const cacheDir = path.resolve(process.cwd(), 'node_modules', '@shijiu', '.cache')
223
+ if (!fs.existsSync(cacheDir)) {
224
+ fs.mkdirSync(cacheDir);
225
+ }
225
226
  const styleJsFileName = adaptPath.basename(styleFilePath) + `.${hash(styleFilePath)}.js`;
226
227
  const styleJsFilePath = adaptPath.join(cacheDir, styleJsFileName);
227
228