mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added vite support
This commit is contained in:
parent
efd93156b1
commit
50f1df1d7e
@ -1,33 +1,31 @@
|
||||
const path = require('path')
|
||||
|
||||
const aliases = {
|
||||
"@antd": path.resolve(__dirname, "../../node_modules/antd"),
|
||||
"@": path.resolve(__dirname, 'src'),
|
||||
'~/': `${path.resolve(__dirname, 'src')}/`,
|
||||
"__": __dirname,
|
||||
"@src": path.resolve(__dirname, 'src'),
|
||||
schemas: path.resolve(__dirname, 'constants'),
|
||||
controllers: path.resolve(__dirname, 'src/controllers'),
|
||||
config: path.join(__dirname, 'config'),
|
||||
extensions: path.resolve(__dirname, 'src/extensions'),
|
||||
pages: path.join(__dirname, 'src/pages'),
|
||||
theme: path.join(__dirname, 'src/theme'),
|
||||
locales: path.join(__dirname, 'src/locales'),
|
||||
core: path.join(__dirname, 'src/core'),
|
||||
"@pages": path.join(__dirname, 'src/pages'),
|
||||
components: path.join(__dirname, 'src/components'),
|
||||
models: path.join(__dirname, 'src/models'),
|
||||
}
|
||||
|
||||
module.exports = (config) => {
|
||||
if (typeof config.windowContext.process === 'undefined') {
|
||||
config.windowContext.process = Object()
|
||||
module.exports = (config = {}) => {
|
||||
if (!config.resolve) {
|
||||
config.resolve = {}
|
||||
}
|
||||
if (!config.server) {
|
||||
config.server = {}
|
||||
}
|
||||
|
||||
config.windowContext.process = config.windowContext.__evite
|
||||
config.windowContext.process["versions"] = process.versions
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
...aliases,
|
||||
}
|
||||
config.aliases = {
|
||||
...config.resolve.alias,
|
||||
...aliases,
|
||||
config.resolve.alias = aliases
|
||||
config.server.port = 8000
|
||||
config.server.host = "0.0.0.0"
|
||||
config.server.fs = {
|
||||
allow: [".."]
|
||||
}
|
||||
|
||||
config.css = {
|
||||
|
12
packages/app/index.html
Normal file
12
packages/app/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/vite.entry.jsx"></script>
|
||||
</body>
|
||||
</html>
|
5
packages/app/src/vite.entry.jsx
Normal file
5
packages/app/src/vite.entry.jsx
Normal file
@ -0,0 +1,5 @@
|
||||
import React from "react"
|
||||
import ReactDOM from "react-dom"
|
||||
import App from "./App"
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById("root"))
|
15
packages/app/vite.config.js
Normal file
15
packages/app/vite.config.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import getConfig from "./.config.js"
|
||||
import Pages from 'vite-plugin-pages'
|
||||
import reactRefresh from '@vitejs/plugin-react-refresh'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
reactRefresh(),
|
||||
Pages({
|
||||
react: true,
|
||||
extensions: ['jsx', 'tsx'],
|
||||
}),
|
||||
],
|
||||
...getConfig(),
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user