Yuken Tezuka 3 лет назад
Родитель
Сommit
8d7331f88e
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      packages/hackmd/src/index.js

+ 4 - 3
packages/hackmd/src/index.js

@@ -2,9 +2,10 @@ const fs = require('fs');
 const path = require('path');
 const path = require('path');
 
 
 const isProduction = process.env.NODE_ENV === 'production';
 const isProduction = process.env.NODE_ENV === 'production';
-const stylesJSFile = fs.readFileSync(path.resolve(__dirname, isProduction ? './styles.js' : '../dist/styles.js'));
-const agentJSFile = fs.readFileSync(path.resolve(__dirname, isProduction ? './agent.js' : '../dist/agent.js'));
-const stylesCSSFile = fs.readFileSync(path.resolve(__dirname, isProduction ? './styles.css' : '../dist/styles.css'));
+const dirPath = isProduction ? '.' : '../dist';
+const stylesJSFile = fs.readFileSync(path.resolve(__dirname, `${dirPath}/styles.js`));
+const agentJSFile = fs.readFileSync(path.resolve(__dirname, `${dirPath}/agent.js`));
+const stylesCSSFile = fs.readFileSync(path.resolve(__dirname, `${dirPath}/styles.css`));
 
 
 // export to app as string
 // export to app as string
 export const stylesJS = stylesJSFile.toString();
 export const stylesJS = stylesJSFile.toString();