Merge branch 'plugin-infar-vite' into feature-data-mapping

# Conflicts:
#	plugin/kintone-addins/package.json
#	plugin/kintone-addins/vite.config.js
This commit is contained in:
Tian Dai
2024-06-04 17:21:43 +09:00
4 changed files with 44 additions and 34 deletions

View File

@@ -0,0 +1,2 @@
VITE_SOURCE_MAP = inline
VITE_PORT = 4173

View File

@@ -0,0 +1,2 @@
VITE_SOURCE_MAP = false
VITE_PORT = 4173

View File

@@ -4,21 +4,25 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "tsc && set \"SOURCE_MAP=true\" && vite build && vite preview",
"build": "tsc && vite build && xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
"build:linux": "tsc && vite build && cp -ur dist/*.js ../../backend/Temp",
"build:dev": "tsc && set \"SOURCE_MAP=true\" && vite build && xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
"preview": "vite preview",
"ngrok": "ngrok http http://localhost:4173/",
"vite": "vite dev",
"server": "vite dev & ngrok http 4173",
"watch": "tsc && set \"SOURCE_MAP=true\" && vite build --watch",
"test": "run-p watch server"
"dev": "run-p watch server ngrok",
"watch": "vite build --watch --mode dev",
"server": "vite server",
"ngrok": "ngrok http 4173",
"build": "run-s b:production copy:windows",
"build:dev": "run-s b:dev copy:windows",
"build:linux": "run-s b:production copy:linux",
"build:linux-dev": "run-s b:dev copy:linux",
"b:production": "vite build --mode production",
"b:dev": "vite build --mode dev",
"copy:windows": "xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
"copy:linux": "cp -ur dist/*.js ../../backend/Temp"
},
"devDependencies": {
"@types/jquery": "^3.5.24",
"@types/node": "^20.8.9",
"npm-run-all": "^4.1.5",
"npm-run-all2": "^6.2.0",
"sass": "^1.69.5",
"typescript": "^5.0.2",
"vite": "^4.4.5",

View File

@@ -1,11 +1,12 @@
// vite.config.js
import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import checker from "vite-plugin-checker";
const sourcemap = process.env.SOURCE_MAP === "true";
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
export default defineConfig({
return defineConfig({
plugins: [
checker({
typescript: true,
@@ -21,10 +22,11 @@ export default defineConfig({
// assetFileNames:'alc_kintone_style.css'
},
},
sourcemap: sourcemap?'inline':false,
sourcemap: process.env.VITE_SOURCE_MAP,
},
server: {
port: 4173,
open: '/dist/alc_runtime.js',
}
port: process.env.VITE_PORT,
open: "/dist/alc_runtime.js",
},
});
};