naive-ui/vite.config.js

41 lines
952 B
JavaScript
Raw Normal View History

const path = require('path')
const { babel } = require('@rollup/plugin-babel')
const createNaiveDemoVitePlugin = require('./build/vite-plugin-demo')
module.exports = {
root: __dirname,
plugins: createNaiveDemoVitePlugin(),
alias: [
{
find: 'naive-ui',
replacement: path.resolve(__dirname, './src')
}
2020-11-02 15:40:23 +08:00
],
define: {
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
__DEV__: process.env.NODE_ENV !== 'production'
},
optimizeDeps: {
2020-11-01 19:35:00 +08:00
include: [
'highlight.js/lib/core',
2020-11-01 19:35:00 +08:00
'highlight.js/lib/languages/cpp',
'highlight.js/lib/languages/javascript',
'highlight.js/lib/languages/python',
'@vicons/fluent/Compose16Regular.js',
'date-fns/locale'
2020-11-01 19:35:00 +08:00
]
},
build: {
outDir: 'site',
minify: false,
rollupOptions: {
plugins: [
babel({
babelHelpers: 'bundled'
// exclude: 'node_modules/highlight.js/**'
})
]
2020-11-02 21:41:40 +08:00
}
}
}