代码拉取完成,页面将自动刷新
import path from 'path'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import ts from 'rollup-plugin-typescript2'
import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'
const banner = `/*!
/**
* vuex-router-sync v${pkg.version}
* (c) ${new Date().getFullYear()} Evan You
* @license MIT
*/`
const configs = [
{ file: 'dist/vuex-router-sync.esm-browser.js', format: 'es', browser: true, env: 'development' },
{ file: 'dist/vuex-router-sync.esm-browser.prod.js', format: 'es', browser: true, env: 'production' },
{ file: 'dist/vuex-router-sync.esm-bundler.js', format: 'es', env: 'development' },
{ file: 'dist/vuex-router-sync.global.js', format: 'iife', env: 'development' },
{ file: 'dist/vuex-router-sync.global.prod.js', format: 'iife', minify: true, env: 'production' },
{ file: 'dist/vuex-router-sync.cjs.js', format: 'cjs', env: 'development' }
]
export function createEntries() {
return configs.map((c) => createEntry(c))
}
function createEntry(config) {
const c = {
input: 'src/index.ts',
plugins: [],
output: {
banner,
file: config.file,
format: config.format
},
onwarn: (msg, warn) => {
if (!/Circular/.test(msg)) {
warn(msg)
}
}
}
if (config.format === 'iife' || config.format === 'umd') {
c.output.name = c.output.name || 'VuexRouterSync'
}
c.plugins.push(resolve())
c.plugins.push(commonjs())
c.plugins.push(ts({
check: config.format === 'es' && config.browser && config.env === 'development',
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
tsconfigOverride: {
compilerOptions: {
declaration: config.format === 'es' && config.browser && config.env === 'development',
target: config.format === 'iife' || config.format === 'cjs' ? 'es5' : 'es2018'
},
exclude: ['test']
}
}))
if (config.minify) {
c.plugins.push(terser({ module: config.format === 'es' }))
}
return c
}
export default createEntries()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。