Skip to content

Commit d9c7a7a

Browse files
Adding playground node_env
1 parent dd28f46 commit d9c7a7a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"dev": "vite",
1111
"watch": "pnpm dev",
12-
"play": "sh src/playground/configs/build.sh && vite",
12+
"play": "sh src/playground/configs/build.sh && NODE_ENV=playground vite",
1313
"bundle": "rollup -c --bundleConfigAsCjs",
1414
"build": "vite build",
1515
"predeploy": "npm run build",

src/plugin/styles/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Before you get started, please read the [Contributing](https://github.com/webdev
1313
4. Install the node packages `pnpm i`. Please do not use `npm` or `yarn`.
1414
5. Run the development server with the developer playground `pnpm play`.
1515
6. You can view the demo site at the link provided by vite that will display in the console. Ex. `http://localhost:5173/vue3-code-block/`
16-
7. You can view the playground page by adding `playground/` to the demo site link provided by vite that will display in the console. Ex. `http://localhost:5173/vue3-code-block/playground/`
16+
7. The playground page will open automatically or can be viewed by adding `playground/` to the demo site link provided by vite that will display in the console. Ex. `http://localhost:5173/vue3-code-block/playground/`. The base site link will also be working.
1717

1818
## 📋 Additional notes
1919
Make sure you are not adding a theme that already exists.

vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { defineConfig } from 'vite';
55
import { fileURLToPath, URL } from 'node:url';
66
import stylelint from 'vite-plugin-stylelint';
77

8+
const baseUrl = '/vue3-code-block/';
9+
const playgroundUrl = baseUrl + 'playground/';
10+
811

912
export default defineConfig({
1013
base: '/vue3-code-block/',
@@ -43,7 +46,7 @@ export default defineConfig({
4346
],
4447
},
4548
server: {
46-
open: false,
49+
open: process?.env?.NODE_ENV === 'playground' ? playgroundUrl : false,
4750
},
4851
});
4952

0 commit comments

Comments
 (0)