chore: format code

This commit is contained in:
Vben
2021-04-05 22:23:39 +08:00
parent f7499cdb0d
commit 3576d0b512
20 changed files with 364 additions and 149 deletions

View File

@@ -5,13 +5,16 @@ import { resolve } from 'path';
import { generateModifyVars } from './build/config/themeConfig';
import { createProxy } from './build/vite/proxy';
import { createAlias } from './build/vite/alias';
import { wrapperEnv } from './build/utils';
import { createVitePlugins } from './build/vite/plugin';
import { OUTPUT_DIR } from './build/constant';
import pkg from './package.json';
import moment from 'moment';
function pathResolve(dir: string) {
return resolve(process.cwd(), '.', dir);
}
const { dependencies, devDependencies, name, version } = pkg;
const __APP_INFO__ = {
pkg: { dependencies, devDependencies, name, version },
@@ -34,12 +37,19 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
base: VITE_PUBLIC_PATH,
root,
resolve: {
alias: createAlias([
alias: [
// /@/xxxx => src/xxxx
['/@/', 'src'],
{
find: /\/@\//,
replacement: pathResolve('src') + '/',
},
// /#/xxxx => types/xxxx
['/#/', 'types'],
]),
{
find: /\/#\//,
replacement: pathResolve('types') + '/',
},
// ['@vue/compiler-sfc', '@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js'],
],
},
server: {
port: VITE_PORT,