@rpgjs/vite 5.0.0-alpha.35 → 5.0.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/module-config.ts +13 -0
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import { join, extname, relative, dirname } from 'path';
|
|
|
3
3
|
import { defineConfig, build } from 'vite';
|
|
4
4
|
import canvasengine from '@canvasengine/compiler';
|
|
5
5
|
import dts from 'vite-plugin-dts';
|
|
6
|
+
import { existsSync as existsSync$1 } from 'node:fs';
|
|
7
|
+
import { resolve } from 'node:path';
|
|
6
8
|
|
|
7
9
|
function tiledMapFolderPlugin(options) {
|
|
8
10
|
const {
|
|
@@ -127,6 +129,12 @@ function tiledMapFolderPlugin(options) {
|
|
|
127
129
|
|
|
128
130
|
function createBuildConfig({ side, watch }) {
|
|
129
131
|
const isClient = side === "client";
|
|
132
|
+
const runtimeDir = resolve(process.cwd(), "runtime");
|
|
133
|
+
const resolveOptions = existsSync$1(runtimeDir) ? {
|
|
134
|
+
alias: {
|
|
135
|
+
"@common": runtimeDir
|
|
136
|
+
}
|
|
137
|
+
} : void 0;
|
|
130
138
|
const plugins = isClient ? [
|
|
131
139
|
canvasengine(),
|
|
132
140
|
removeImportsPlugin({ patterns: [/server/] }),
|
|
@@ -138,6 +146,7 @@ function createBuildConfig({ side, watch }) {
|
|
|
138
146
|
return {
|
|
139
147
|
configFile: false,
|
|
140
148
|
// Prevent using this config file
|
|
149
|
+
resolve: resolveOptions,
|
|
141
150
|
plugins: [
|
|
142
151
|
...plugins,
|
|
143
152
|
dts({
|
|
@@ -159,7 +168,9 @@ function createBuildConfig({ side, watch }) {
|
|
|
159
168
|
rollupOptions: {
|
|
160
169
|
external: [
|
|
161
170
|
/@rpgjs/,
|
|
171
|
+
/@signestack/,
|
|
162
172
|
"canvasengine",
|
|
173
|
+
"pixi.js",
|
|
163
174
|
"esbuild",
|
|
164
175
|
"@canvasengine/presets",
|
|
165
176
|
"rxjs"
|