chore: use rollup-plugin-dts

This commit is contained in:
Christian Kaisermann 2022-04-05 17:21:01 +02:00
parent a8b5df0442
commit e91e822df1
6 changed files with 14718 additions and 7317 deletions

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
node_modules
*.log
/coverage/
/dist/
/types/
/dist/

14752
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"version": "3.3.13",
"main": "dist/runtime.cjs.js",
"module": "dist/runtime.esm.js",
"types": "types/runtime/index.d.ts",
"types": "dist/runtime.d.ts",
"bin": {
"svelte-i18n": "dist/cli.js"
},
@ -22,9 +22,8 @@
"node": ">= 11.15.0"
},
"scripts": {
"clean": "rm -rf dist/ types/",
"clean": "rm -rf dist/",
"build": "rollup -c",
"build:types": "tsc -p src/runtime --emitDeclarationOnly",
"dev": "rollup -c -w",
"test": "cross-env NODE_ICU_DATA=node_modules/full-icu jest",
"test:ci": "npm run test -- --silent",
@ -32,13 +31,11 @@
"format": "prettier --loglevel silent --write \"{src,test}/**/*.ts\"",
"release": " git add package.json && git commit -m \"chore(release): v$npm_package_version :tada:\"",
"prebuild": "yarn clean",
"postbuild": "yarn build:types",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1 && git add CHANGELOG.md",
"prepublishOnly": "npm run test && npm run build"
},
"files": [
"dist/",
"types/"
"dist/"
],
"husky": {
"hooks": {
@ -95,6 +92,7 @@
"rollup": "^2.27.1",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-dts": "^4.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.2",
"sass": "^1.26.11",

View File

@ -2,12 +2,14 @@ import commonjs from '@rollup/plugin-commonjs';
import ts from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';
import autoExternal from 'rollup-plugin-auto-external';
import dts from 'rollup-plugin-dts';
import pkg from './package.json';
const PROD = !process.env.ROLLUP_WATCH;
export default [
// bundle runtime
{
input: 'src/runtime/index.ts',
external: [
@ -21,6 +23,13 @@ export default [
],
plugins: [commonjs(), autoExternal(), ts(), PROD && terser()],
},
// bundle types for runtime
{
input: 'src/runtime/index.ts',
output: [{ file: pkg.types, format: 'es' }],
plugins: [dts()],
},
// build CLI
{
input: 'src/cli/index.ts',
output: [

View File

@ -7,8 +7,7 @@ import type {
TimeFormatter,
DateFormatter,
NumberFormatter,
MissingKeyHandler,
} from '../../../src/runtime/types/index';
} from '../../../src/runtime/types';
import {
$format,
$formatTime,

7258
yarn.lock

File diff suppressed because it is too large Load Diff