forked from vb/lazyframe
-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.js
68 lines (62 loc) · 1.93 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// View your website at your own local server
// for example http://vite-php-setup.test
// http://localhost:3000 is serving Vite on development
// but accessing it directly will be empty
// IMPORTANT image urls in CSS works fine
// BUT you need to create a symlink on dev server to map this folder during dev:
// ln -s {path_to_vite}/src/assets {path_to_public_html}/assets
// on production everything will work just fine
// import liveReload from 'vite-plugin-live-reload';
import { defineConfig } from 'vite'
// import vue from '@vitejs/plugin-vue'
const path = require('path');
// const { resolve } = require('path');
console.log(process.env.NODE_ENV);
export default {
// resolve: {
// alias: {
// // alias a path to a fs directory
// // the key must start and end with a slash
// '/@/': path.resolve(__dirname, 'src')
// }
// },
// root: 'src/',
base: process.env.NODE_ENV === 'development' ? '/' : '/lazyframeAdvanced/',
// plugins: [
// liveReload(__dirname+'/dist/site/templates/**/*.(php|tpl|html)'),
// // vue()
// // edit according to your source code
// ],
server: {
// port: 3000,
cors: true,
// we need a strict port to match on PHP side
// change freely, but update on PHP to match the same port
// strictPort: true,
https: true,
},
build: {
// input: {
// 'entry-point-a': path.resolve(__dirname, 'src/lazyframe.js'),
// 'entry-point-b': path.resolve(__dirname, 'src/scss/lazyframe.scss'),
// },
lib: {
entry: path.resolve(__dirname, 'src/lazyframe.js'),
name: 'lazyframe'
},
// outDir: '/dist/',
// emptyOutDir: true,
assetsDir: './',
// generate manifest.json in outDir
manifest: false,
rollupOptions: {
// overwrite default .html entry
input: './src/lazyframe.js',
output: {
exports: "default",
format: "es",
// entryFileNames: 'entry-[name].js'
}
}
}
};