2020-09-29 15:03:46 +08:00
|
|
|
const path = require('path')
|
2020-11-02 04:23:28 +08:00
|
|
|
const alias = require('@rollup/plugin-alias')
|
2020-09-29 15:03:46 +08:00
|
|
|
|
2020-11-02 04:23:28 +08:00
|
|
|
const { viteMdPlugin, rollupMdPlugin } = require('./demo/vite-plugins/mdPlugin')
|
2020-10-26 15:03:02 +08:00
|
|
|
|
2020-09-29 15:03:46 +08:00
|
|
|
module.exports = {
|
|
|
|
root: __dirname,
|
2020-11-02 04:23:28 +08:00
|
|
|
plugins: [ viteMdPlugin() ],
|
2020-10-26 15:03:02 +08:00
|
|
|
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'
|
|
|
|
]
|
2020-10-26 15:03:02 +08:00
|
|
|
},
|
2020-09-29 15:03:46 +08:00
|
|
|
alias: {
|
2020-11-01 19:35:00 +08:00
|
|
|
'/@naive-ui/lib/icons/': path.resolve(__dirname, './src/_deprecated/icons'),
|
2020-10-26 15:03:02 +08:00
|
|
|
'/@naive-ui/': path.resolve(__dirname, './src'),
|
|
|
|
'src': path.resolve(__dirname, './src')
|
2020-09-29 15:03:46 +08:00
|
|
|
},
|
|
|
|
define: {
|
|
|
|
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
|
2020-10-30 17:42:34 +08:00
|
|
|
'__DEV__': process.env !== 'production'
|
2020-11-02 04:23:28 +08:00
|
|
|
},
|
|
|
|
rollupInputOptions: {
|
|
|
|
plugins: [
|
|
|
|
alias({
|
|
|
|
entries: [
|
|
|
|
{
|
|
|
|
find: /^naive-ui\/lib\/icons\//g,
|
|
|
|
replacement: './src/_deprecated/icons/'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
rollupMdPlugin()
|
|
|
|
]
|
2020-09-29 15:03:46 +08:00
|
|
|
}
|
|
|
|
}
|