|
@@ -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();
|