feat: 添加只打包esm的npm script

This commit is contained in:
张淑峰 2023-07-13 14:13:24 +08:00
parent 2e5431f566
commit 9726094813
15 changed files with 43 additions and 0 deletions

View File

@ -16,6 +16,7 @@
"fis3-dev": "fis3 release -cwd ./public",
"deploy-gh-page": "sh ./deploy-gh-pages.sh",
"build": "npm run build --workspaces",
"build-esm": "npm run build-esm --workspaces",
"test": "npm test --workspaces",
"update-snapshot": "npm run update-snapshot --workspaces",
"prepare": "husky install",

View File

@ -34,6 +34,7 @@
},
"scripts": {
"build": "npm run clean-dist && NODE_ENV=production rollup -c ",
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
"dev": "rollup -c -w",
"test": "jest",
"update-snapshot": "jest --updateSnapshot",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -28,6 +28,7 @@
"scripts": {
"test": "echo \"Warnings: no test specified\"",
"build": "npm run clean-dist && NODE_ENV=production rollup -c",
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
"clean-dist": "rimraf lib/* esm/*",
"i18n:update": "npx i18n update --config=./i18nConfig.js",
"i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -22,6 +22,7 @@
"scripts": {
"test": "echo \"Warnings: no test specified\"",
"build": "npm run clean-dist && NODE_ENV=production rollup -c ",
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
"clean-dist": "rimraf lib/** esm/**",
"i18n:update": "npx i18n update --config=./i18nConfig.js",
"i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -7,6 +7,7 @@
"types": "lib/index.d.ts",
"scripts": {
"build": "npm run clean-dist && npm run genDoc && cross-env NODE_ENV=production rollup -c && cp src/doc.md lib/doc.md && cp src/doc.md esm/doc.md",
"build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js",
"lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c",
"clean-dist": "rimraf lib/**",
"declaration": "tsc --project tsconfig-for-declaration.json --allowJs --declaration --emitDeclarationOnly --declarationDir ./lib --rootDir ./src",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -7,6 +7,7 @@
"description": "",
"scripts": {
"build": "npm run clean-dist && NODE_ENV=production rollup -c ",
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
"dev": "rollup -c -w",
"test": "jest",
"gen-doc": "ts-node ./scripts/genDoc.ts",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -11,6 +11,7 @@
"coverage": "jest --coverage",
"publish-to-internal": "sh build.sh && sh publish.sh",
"build": "npm run clean-dist && sh build.sh",
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
"prettier": "prettier --write '{src,scss,examples}/**/**/*.{js,jsx,ts,tsx,scss,json}'",
"build-schemas": "ts-node -O '{\"target\":\"es6\"}' ../../scripts/build-schemas.ts",
"clean-dist": "rimraf lib/** esm/**"

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;

View File

@ -8,6 +8,7 @@
"scripts": {
"dev": "vite",
"build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c ",
"build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js",
"test": "jest",
"lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c",
"update-snapshot": "jest --updateSnapshot",

View File

@ -0,0 +1,5 @@
import config from "./rollup.config";
const esmConfig = config[1];
export default esmConfig;