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:
2
plugin/kintone-addins/.env.dev
Normal file
2
plugin/kintone-addins/.env.dev
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_SOURCE_MAP = inline
|
||||||
|
VITE_PORT = 4173
|
||||||
2
plugin/kintone-addins/.env.production
Normal file
2
plugin/kintone-addins/.env.production
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_SOURCE_MAP = false
|
||||||
|
VITE_PORT = 4173
|
||||||
@@ -4,21 +4,25 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsc && set \"SOURCE_MAP=true\" && vite build && vite preview",
|
"dev": "run-p watch server ngrok",
|
||||||
"build": "tsc && vite build && xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
|
"watch": "vite build --watch --mode dev",
|
||||||
"build:linux": "tsc && vite build && cp -ur dist/*.js ../../backend/Temp",
|
"server": "vite server",
|
||||||
"build:dev": "tsc && set \"SOURCE_MAP=true\" && vite build && xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
|
"ngrok": "ngrok http 4173",
|
||||||
"preview": "vite preview",
|
|
||||||
"ngrok": "ngrok http http://localhost:4173/",
|
"build": "run-s b:production copy:windows",
|
||||||
"vite": "vite dev",
|
"build:dev": "run-s b:dev copy:windows",
|
||||||
"server": "vite dev & ngrok http 4173",
|
"build:linux": "run-s b:production copy:linux",
|
||||||
"watch": "tsc && set \"SOURCE_MAP=true\" && vite build --watch",
|
"build:linux-dev": "run-s b:dev copy:linux",
|
||||||
"test": "run-p watch server"
|
|
||||||
|
"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": {
|
"devDependencies": {
|
||||||
"@types/jquery": "^3.5.24",
|
"@types/jquery": "^3.5.24",
|
||||||
"@types/node": "^20.8.9",
|
"@types/node": "^20.8.9",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all2": "^6.2.0",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
"typescript": "^5.0.2",
|
"typescript": "^5.0.2",
|
||||||
"vite": "^4.4.5",
|
"vite": "^4.4.5",
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
// vite.config.js
|
// vite.config.js
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig, loadEnv } from "vite";
|
||||||
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
||||||
import checker from "vite-plugin-checker";
|
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: [
|
plugins: [
|
||||||
checker({
|
checker({
|
||||||
typescript: true,
|
typescript: true,
|
||||||
}),
|
}),
|
||||||
cssInjectedByJsPlugin(),
|
cssInjectedByJsPlugin(),
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
cssCodeSplit: false,
|
cssCodeSplit: false,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: "src/index.ts", // entry file
|
input: "src/index.ts", // entry file
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: "alc_runtime.js",
|
entryFileNames: "alc_runtime.js",
|
||||||
// assetFileNames:'alc_kintone_style.css'
|
// assetFileNames:'alc_kintone_style.css'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
sourcemap: process.env.VITE_SOURCE_MAP,
|
||||||
},
|
},
|
||||||
sourcemap: sourcemap?'inline':false,
|
server: {
|
||||||
},
|
port: process.env.VITE_PORT,
|
||||||
server: {
|
open: "/dist/alc_runtime.js",
|
||||||
port: 4173,
|
},
|
||||||
open: '/dist/alc_runtime.js',
|
});
|
||||||
}
|
};
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user