naive-ui/vite.config.js

41 lines
1012 B
JavaScript
Raw Normal View History

const path = require('path')
const alias = require('@rollup/plugin-alias')
const { viteMdPlugin, rollupMdPlugin } = require('./demo/vite-plugins/mdPlugin')
module.exports = {
root: __dirname,
plugins: [ viteMdPlugin() ],
optimizeDeps: {
2020-11-01 19:35:00 +08:00
include: [
'highlight.js/lib/languages/cpp',
'highlight.js/lib/highlight',
'highlight.js/lib/languages/javascript',
'highlight.js/lib/languages/python',
'vooks'
]
},
alias: {
2020-11-01 19:35:00 +08:00
'/@naive-ui/lib/icons/': path.resolve(__dirname, './src/_deprecated/icons'),
'/@naive-ui/': path.resolve(__dirname, './src'),
'src': path.resolve(__dirname, './src')
},
define: {
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
2020-10-30 17:42:34 +08:00
'__DEV__': process.env !== 'production'
},
rollupInputOptions: {
plugins: [
alias({
entries: [
{
find: /^naive-ui\/lib\/icons\//g,
replacement: './src/_deprecated/icons/'
}
]
}),
rollupMdPlugin()
]
}
}