[inula][inula-intl][inula-router][inula-request]<feat> 构建方式适配 monorepo
This commit is contained in:
parent
f129119610
commit
43659e3d2d
|
@ -23,7 +23,7 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MulanPSL2",
|
"license": "MulanPSL2",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"inulajs": "^0.0.12"
|
"openinula": "^0.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.21.3",
|
"@babel/core": "7.21.3",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"bugs": "",
|
"bugs": "",
|
||||||
"license": "MulanPSL2",
|
"license": "MulanPSL2",
|
||||||
"main": "index.js",
|
"main": "./build/index.js",
|
||||||
"repository": {},
|
"repository": {},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
|
@ -23,5 +23,6 @@
|
||||||
"test": "jest --config=jest.config.js",
|
"test": "jest --config=jest.config.js",
|
||||||
"watch-test": "yarn test --watch --dev"
|
"watch-test": "yarn test --watch --dev"
|
||||||
},
|
},
|
||||||
"types": "@types/index.d.ts"
|
"files": ["build/@types", "build/cjs", "build/umd", "build/index.js", "build/jsx-dev-runtime.js", "build/jsx-runtime.js"],
|
||||||
|
"types": "./build/@types/index.d.ts"
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,12 +53,12 @@ export function cleanUp(folders) {
|
||||||
|
|
||||||
function buildTypeConfig() {
|
function buildTypeConfig() {
|
||||||
return {
|
return {
|
||||||
input: ['./build/inula/@types/index.d.ts'],
|
input: ['./build/@types/index.d.ts'],
|
||||||
output: {
|
output: {
|
||||||
file: './build/inula/@types/index.d.ts',
|
file: './build/@types/index.d.ts',
|
||||||
format: 'es',
|
format: 'es',
|
||||||
},
|
},
|
||||||
plugins: [dts(), cleanUp(['./build/inula/@types/'])],
|
plugins: [dts(), cleanUp(['./build/@types/'])],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ const extensions = ['.js', '.ts'];
|
||||||
|
|
||||||
const libDir = path.join(__dirname, '../..');
|
const libDir = path.join(__dirname, '../..');
|
||||||
const rootDir = path.join(__dirname, '../..');
|
const rootDir = path.join(__dirname, '../..');
|
||||||
const outDir = path.join(rootDir, 'build', 'inula');
|
const outDir = path.join(rootDir, 'build');
|
||||||
|
|
||||||
if (!fs.existsSync(path.join(rootDir, 'build'))) {
|
if (!fs.existsSync(path.join(rootDir, 'build'))) {
|
||||||
fs.mkdirSync(path.join(rootDir, 'build'));
|
fs.mkdirSync(path.join(rootDir, 'build'));
|
||||||
|
@ -95,11 +95,7 @@ function genConfig(mode) {
|
||||||
{
|
{
|
||||||
from: path.join(libDir, '/npm/index.js'),
|
from: path.join(libDir, '/npm/index.js'),
|
||||||
to: path.join(outDir, 'index.js'),
|
to: path.join(outDir, 'index.js'),
|
||||||
},
|
}
|
||||||
{
|
|
||||||
from: path.join(libDir, 'package.json'),
|
|
||||||
to: path.join(outDir, 'package.json'),
|
|
||||||
},
|
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"declarationDir": "./build/inula/@types"
|
"declarationDir": "./build/@types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue