Przeglądaj źródła

BugFix and modify package.json to ensure that clean script run before build

Yuki Takei 9 lat temu
rodzic
commit
e1597ecf1d

+ 5 - 1
packages/growi-plugin-lsx/package.json

@@ -8,8 +8,11 @@
   ],
   "scripts": {
     "build": "NODE_ENV=production babel src --out-dir lib --source-maps inline",
+    "clean": "npm cache clean && npm run rimraf -- lib",
     "postbuild": "ncp 'src/resource/css' lib/resource/css",
+    "prebuild": "npm run clean",
     "watch": "babel src --out-dir lib --watch --source-maps inline",
+    "rimraf": "rimraf",
     "test": "mocha --compilers js:babel-register test/*.js"
   },
   "repository": {
@@ -35,6 +38,7 @@
     "babel-preset-react": "^6.23.0",
     "babel-register": "^6.23.0",
     "ncp": "^2.0.0",
-    "power-assert": "^1.4.2"
+    "power-assert": "^1.4.2",
+    "rimraf": "^2.6.1"
   }
 }

+ 1 - 1
packages/growi-plugin-lsx/src/lib/routes/lsx.js

@@ -1,7 +1,7 @@
 module.exports = (crowi, app) => {
   var debug = require('debug')('crowi-plugin:lsx:routes:lsx')
     , path = require('path')
-    , LsxPageListRenderer = require('../util/Lsx')
+    , LsxPageListRenderer = require('../util/LsxPageListRenderer')
     , lsx = new LsxPageListRenderer(crowi, app)
     , ApiResponse = crowi.require('../util/apiResponse')
     , actions = {};

+ 1 - 1
packages/growi-plugin-lsx/src/lib/util/LsxPageListRenderer.js

@@ -35,7 +35,7 @@ class LsxPageListRenderer {
     }
 
     // resolve path
-    const pagePath = path.resolve(fromPath, lsxPrefix);
+    const pagePath = path.resolve(fromPagePath, lsxPrefix);
     const queryOptions = {}
 
     // find pages