1 Star 0 Fork 174

xzy123 / nutui

forked from 京东零售 / nutui 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.build.taro.vue.ts 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
suzigang 提交于 2022-01-25 17:21 . fix: taro failed resolve component
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import config from './package.json';
const banner = `/*!
* ${config.name} v${config.version} ${new Date()}
* (c) 2021 @jdf2e.
* Released under the MIT License.
*/`;
export default defineConfig({
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, './src') }]
},
css: {
preprocessorOptions: {
scss: {
// example : additionalData: `@import "./src/design/styles/variables";`
// dont need include file extend .scss
additionalData: `@import "@/packages/styles/variables.scss";@import "@/sites/assets/styles/variables.scss";`
}
}
},
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => {
return (
tag.startsWith('scroll-view') ||
tag.startsWith('swiper') ||
tag.startsWith('swiper-item') ||
tag.startsWith('picker')
);
},
whitespace: 'preserve'
}
}
})
],
build: {
minify: false,
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
},
rollupOptions: {
// 请确保外部化那些你的库中不需要的依赖
external: ['vue', 'vue-router', '@tarojs/taro'],
output: {
banner,
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
globals: {
vue: 'Vue'
}
}
},
lib: {
entry: 'src/packages/nutui.taro.vue.build.ts',
name: 'nutui',
fileName: 'nutui',
formats: ['es', 'umd']
}
}
});
JavaScript
1
https://gitee.com/xzy258/nutui.git
git@gitee.com:xzy258/nutui.git
xzy258
nutui
nutui
next

搜索帮助