Skip to content

Commit 1ab8258

Browse files
committed
fix: webpack.config and package.json make use of mode=production instead of process.env
1 parent dc98ef7 commit 1ab8258

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"scripts": {
2727
"start": "npx webpack --config webpack.config.js",
28-
"build": "NODE_ENV=production npx webpack --config webpack.config.js",
28+
"build": "npx webpack --mode=production --config webpack.config.js",
2929
"dev": "npx webpack --config webpack.config.js --watch",
3030
"postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
3131
},

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ class CoCreateServerSideRender {
4848
dep.push(key)
4949

5050
let cacheKey = _id + array;
51-
let record;
51+
let data;
5252
if (dbCache.has(cacheKey))
53-
record = dbCache.get(cacheKey)
53+
data = dbCache.get(cacheKey)
5454
else {
55-
record = await self.crud.send({
55+
data = await self.crud.send({
5656
method: 'read.object',
5757
array,
5858
object: {
5959
_id
6060
},
6161
organization_id
6262
});
63-
if (record && record.object && record.object[0])
64-
record = record.object[0]
63+
if (data && data.object && data.object[0])
64+
data = data.object[0]
6565

66-
dbCache.set(cacheKey, record)
66+
dbCache.set(cacheKey, data)
6767
}
6868

69-
if (!record || !record[name]) {
69+
if (!data || !data[name]) {
7070
dep.pop();
7171
continue;
7272
}
73-
let chunk = record[name];
73+
let chunk = data[name];
7474
if (!chunk) {
7575
dep.pop();
7676
continue;

0 commit comments

Comments
 (0)