Skip to content

Commit

Permalink
Merge pull request #1 from hi-ogawa/chore-repro
Browse files Browse the repository at this point in the history
chore: repro for vitejs/vite#17648
  • Loading branch information
silverwind committed Aug 12, 2024
2 parents 20152b7 + bca7985 commit 6edcde0
Show file tree
Hide file tree
Showing 4 changed files with 895 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {foo} from "lib";
console.log(foo());
console.log(import.meta.env["VITE_CUSTOM"]);
console.log(import.meta.env.VITE_CUSTOM);
// console.log(import.meta.env["VITE_CUSTOM"]);
// console.log(import.meta.env.VITE_CUSTOM);
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {createStore} from "zustand";

export const foo = () => {
return createStore();
// https://github.com/pmndrs/zustand/blob/a56e76db5261291dcf9a88573dac58f67edb93db/rollup.config.js#L67-L70
console.log(import.meta.env ? import.meta.env.MODE : undefined);

// this could be any "define" which is used in app mode but not in lib mode.
console.log(process.env.TEST);
};
Loading

0 comments on commit 6edcde0

Please sign in to comment.