2020-09-29 15:03:46 +08:00
|
|
|
const path = require('path')
|
2020-12-04 18:12:24 +08:00
|
|
|
const { babel } = require('@rollup/plugin-babel')
|
2021-01-12 13:17:26 +08:00
|
|
|
const createNaiveDemoVitePlugin = require('./build/vite-plugin-demo')
|
2020-10-26 15:03:02 +08:00
|
|
|
|
2020-09-29 15:03:46 +08:00
|
|
|
module.exports = {
|
|
|
|
root: __dirname,
|
2021-01-12 13:17:26 +08:00
|
|
|
plugins: createNaiveDemoVitePlugin(),
|
|
|
|
alias: [
|
|
|
|
{
|
|
|
|
find: 'naive-ui',
|
|
|
|
replacement: path.resolve(__dirname, './src')
|
|
|
|
}
|
2020-11-02 15:40:23 +08:00
|
|
|
],
|
2021-01-12 13:17:26 +08:00
|
|
|
define: {
|
|
|
|
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
|
|
|
|
__DEV__: process.env.NODE_ENV !== 'production'
|
|
|
|
},
|
2020-10-26 15:03:02 +08:00
|
|
|
optimizeDeps: {
|
2020-11-01 19:35:00 +08:00
|
|
|
include: [
|
2020-12-04 18:12:24 +08:00
|
|
|
'highlight.js/lib/core',
|
2020-11-01 19:35:00 +08:00
|
|
|
'highlight.js/lib/languages/cpp',
|
|
|
|
'highlight.js/lib/languages/javascript',
|
2021-01-12 13:17:26 +08:00
|
|
|
'highlight.js/lib/languages/python',
|
|
|
|
'@vicons/fluent/Compose16Regular.js',
|
|
|
|
'date-fns/locale'
|
2020-11-01 19:35:00 +08:00
|
|
|
]
|
2020-10-26 15:03:02 +08:00
|
|
|
},
|
2021-01-12 13:17:26 +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
|
|
|
}
|
2021-01-12 13:17:26 +08:00
|
|
|
}
|
2020-09-29 15:03:46 +08:00
|
|
|
}
|