mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01:00
chore: use rollup-plugin-dts
This commit is contained in:
parent
a8b5df0442
commit
e91e822df1
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,3 @@ node_modules
|
||||
*.log
|
||||
/coverage/
|
||||
/dist/
|
||||
/types/
|
||||
|
14752
package-lock.json
generated
14752
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -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",
|
||||
|
@ -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: [
|
||||
|
@ -7,8 +7,7 @@ import type {
|
||||
TimeFormatter,
|
||||
DateFormatter,
|
||||
NumberFormatter,
|
||||
MissingKeyHandler,
|
||||
} from '../../../src/runtime/types/index';
|
||||
} from '../../../src/runtime/types';
|
||||
import {
|
||||
$format,
|
||||
$formatTime,
|
||||
|
Loading…
Reference in New Issue
Block a user