vite: add back path.resolve to make build command work
although vite dev works without it
This commit is contained in:
parent
357245d234
commit
3e6c9c2299
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { resolve } from 'path';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
||||||
import { viteSingleFile } from 'vite-plugin-singlefile';
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
||||||
|
|
@ -31,7 +32,7 @@ export default defineConfig({
|
||||||
{
|
{
|
||||||
ejs: (viteConfig) => ({
|
ejs: (viteConfig) => ({
|
||||||
// ejs options goes here.
|
// ejs options goes here.
|
||||||
views: [__dirname],
|
views: [resolve(__dirname)],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
|
import { resolve } from 'path';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
import { TransformEjs } from './src/lib/vite-plugins';
|
import { TransformEjs } from './src/lib/vite-plugins';
|
||||||
|
|
||||||
|
const rootDir = resolve(__dirname, 'src')
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
root: 'src',
|
root: 'src',
|
||||||
build: {
|
build: {
|
||||||
|
|
@ -9,12 +12,9 @@ export default defineConfig({
|
||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
main: 'index.html',
|
main: resolve(rootDir, 'index.html'),
|
||||||
editor: 'editor/index.html',
|
editor: resolve(rootDir, 'editor/index.html'),
|
||||||
preview: 'preview/index.html',
|
preview: resolve(rootDir, 'preview/index.html'),
|
||||||
// main: resolve(rootDir, 'index.html'),
|
|
||||||
// editor: resolve(rootDir, 'editor/index.html'),
|
|
||||||
// editorPreview: resolve(rootDir, 'editor/preview.html'),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue