Commit 178de5b9 authored by mxm-web-develop's avatar mxm-web-develop

init

parents
/* .babelrc */
{
"presets": [
[
"@babel/preset-env",
{
/* Babel 会在 Rollup 有机会做处理之前,将我们的模块转成 CommonJS,导致 Rollup 的一些处理失败 */
"modules": false
}
]
]
}
node_modules
\ No newline at end of file
{
"name": "mxm-fzm-service",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.26.0",
"typescript": "^4.5.5"
},
"devDependencies": {
"rollup": "^2.68.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"vuepress": "^1.9.7"
}
}
import path from 'path'
import { RollupOptions } from 'rollup'
import rollupTypescript from 'rollup-plugin-typescript2'
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import { terser } from "rollup-plugin-terser";
import { DEFAULT_EXTENSIONS } from '@babel/core'
import pkg from './package.json'
function createEntry(options){
const config ={
input:['./src/components/index.ts'],
output:{
file:options.file,
name:options.name,
format:options.format,
},
plugins:[
resolve(),
commonjs(),
rollupTypescript({
tsconfigOverride:{
compilerOptions:{
declaration:options.format === 'es'
},
// include: ["src/components/**/*.vue"],
// exclude: ["node_modules", "**/*.stories.ts"]
}
}),
terser()
]}
}
\ No newline at end of file
import axios, { AxiosInstance } from 'axios';
/* tsconfig.json */
{
"compilerOptions": {
/* 基础配置 */
"target": "esnext",
"module": "CommonJS",
"rootDir": "./src",
"lib": [
"dom",
"esnext"
],
"removeComments": false,
"declaration": true,
"sourceMap": true,
/* 强类型检查配置 */
"strict": true,
"noImplicitAny": false,
/* 模块分析配置 */
"baseUrl": ".",
"outDir": "./dist",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true
},
"include": [
"src"
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment