1 Star 0 Fork 8

丷泡泡o0O/mini-sandbox

forked from buuing/mini-sandbox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.build.js 2.61 KB
一键复制 编辑 原始数据 按行查看 历史
ldq 提交于 2022-04-01 19:57 . build: upgrade to v0.3.0 增加 react-loader
import path from 'path'
import ts from 'rollup-plugin-typescript2'
// import dts from 'rollup-plugin-dts'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import babel from 'rollup-plugin-babel'
import { terser } from 'rollup-plugin-terser'
// import del from 'rollup-plugin-delete'
import pkg from './package.json'
import styles from 'rollup-plugin-styles'
export default [
{
input: 'src/index.ts',
output: [
{
file: `${pkg.unpkg}`,
format: 'umd',
name: 'MiniSandbox',
sourcemap: false,
plugins: [terser()],
},
{
file: `${pkg.module}`,
format: 'umd',
name: 'MiniSandbox',
sourcemap: false,
plugins: [terser()],
},
],
plugins: [
styles(),
ts({
tsconfig: path.resolve(__dirname, './tsconfig.json'),
extensions: ['.js', '.ts'],
declaration: true,
}),
json(),
babel({ exclude: 'node_modules/**' }),
resolve(),
commonjs(),
],
},
// docsify plugin
{
input: 'src/plugins/docsify-plugin.ts',
output: [
{
file: 'dist/docsify-plugin.js',
format: 'umd',
name: 'SandboxDocsifyPlugin',
sourcemap: false,
plugins: [terser()],
},
],
plugins: [
ts({
tsconfig: path.resolve(__dirname, './tsconfig.json'),
extensions: ['.js', '.ts'],
declaration: true,
}),
json(),
babel({ exclude: 'node_modules/**' }),
resolve(),
commonjs(),
],
},
// vue loader
{
input: 'src/loaders/vue-loader.ts',
output: [
{
file: 'dist/vue-loader.js',
format: 'umd',
name: 'SandboxVueLoader',
sourcemap: false,
plugins: [terser()],
},
],
plugins: [
ts({
tsconfig: path.resolve(__dirname, './tsconfig.json'),
extensions: ['.js', '.ts'],
declaration: true,
}),
json(),
babel({ exclude: 'node_modules/**' }),
resolve(),
commonjs(),
],
},
// react loader
{
input: 'src/loaders/react-loader.ts',
output: [
{
file: 'dist/react-loader.js',
format: 'umd',
name: 'SandboxReactLoader',
sourcemap: false,
plugins: [terser()],
},
],
plugins: [
ts({
tsconfig: path.resolve(__dirname, './tsconfig.json'),
extensions: ['.js', '.ts'],
declaration: true,
}),
json(),
babel({ exclude: 'node_modules/**' }),
resolve(),
commonjs(),
],
},
]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/qq1099719995/mini-sandbox.git
git@gitee.com:qq1099719995/mini-sandbox.git
qq1099719995
mini-sandbox
mini-sandbox
master

搜索帮助