Skip to content

Commit b1702c6

Browse files
committed
node_env fix
1 parent 47286e9 commit b1702c6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"license": "MIT",
88
"homepage": "https://github.com/way5/react-document-viewer",
99
"scripts": {
10-
"dev": "_ENV='development' vite",
11-
"build": "_ENV='local' vite build",
12-
"build:prod": "_ENV='production' vite build",
10+
"dev": "NODE_ENV='development' vite",
11+
"build": "NODE_ENV='local' vite build",
12+
"build:prod": "NODE_ENV='production' vite build",
1313
"lint": "eslint --config eslint.config.js ./src",
1414
"prettier": "prettier --write '**/*.{js,mjs,cjs,jsx,ts,tsx}'",
1515
"prettier:check": "prettier --check '**/*.{js,mjs,cjs,jsx,ts,tsx}'",

postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module.exports = {
44
'tailwindcss/nesting': 'postcss-nesting',
55
tailwindcss: {},
66
autoprefixer: {}
7-
// ...(process.env._ENV === 'production' ? { cssnano: {} } : {}),
7+
// ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
88
}
99
};

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ReactDocumentViewer from './ReactDocumentViewer';
44

55
window.ReactDocumentViewer = ReactDocumentViewer;
66

7-
if (process.env._ENV === 'development') {
7+
if (process.env.NODE_ENV === 'development') {
88
window.addEventListener('load', () => {
99
window.ReactDocumentViewer = new ReactDocumentViewer({
1010
rootElement: document.getElementById('root'),

vite.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import sassDts from 'vite-plugin-sass-dts';
55
import { viteStaticCopy } from 'vite-plugin-static-copy';
66
// const env = loadEnv(mode, process.cwd(), "");
77

8-
const isProduction = process.env._ENV === 'production';
8+
const isProduction = process.env.NODE_ENV === 'production';
99

1010
// https://vitejs.dev/config/
1111
export default defineConfig(({ command, mode }) => ({

0 commit comments

Comments
 (0)