naive-ui/vite.config.js
Mr.Bai 9fcc91525b
feat(upload): support custom request (#1474)
* feat(upload): support custom request

* optimazitaion

* feat(upload): custom request finished

* feat(upload): update doc

* feat(upload): update changelog

* optimazition

* update change log

* optimazition

* update changelog

* update changelog

* update changelog

* Update src/upload/demos/enUS/index.demo-entry.md

Co-authored-by: 07akioni <07akioni2@gmail.com>

* Update src/upload/demos/zhCN/index.demo-entry.md

Co-authored-by: 07akioni <07akioni2@gmail.com>

Co-authored-by: Jiwen Bai <56228105@qq.com>
Co-authored-by: 07akioni <07akioni2@gmail.com>
2021-11-28 23:03:24 +08:00

67 lines
1.4 KiB
JavaScript

const path = require('path')
const { babel } = require('@rollup/plugin-babel')
const createDemoPlugin = require('./build/vite-plugin-demo')
/**
* @type {import('vite').UserConfig}
*/
module.exports = {
root: __dirname,
plugins: createDemoPlugin(),
resolve: {
// In production site build, we want to import naive-ui from node_modules
alias:
process.env.NODE_ENV !== 'production'
? [
{
find: 'naive-ui',
replacement: path.resolve(__dirname, './src')
}
]
: undefined
},
define: {
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
'process.env.TUSIMPLE': !!process.env.TUSIMPLE,
__DEV__: process.env.NODE_ENV !== 'production'
},
optimizeDeps: {
include: [
'@css-render/plugin-bem',
'async-validator',
'css-render',
'date-fns',
'evtd',
'highlight.js',
'lodash-es',
'seemly',
'treemate',
'vdirs',
'vooks',
'vue',
'vue-router',
'vueuc'
],
exclude: ['__INDEX__']
},
build: {
outDir: 'site',
rollupOptions: {
output: {
manualChunks: {
axios: ['axios']
}
},
plugins: [
babel({
babelHelpers: 'bundled'
})
]
}
},
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment'
}
}