Skip to content

Commit

Permalink
Add rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
andyrichardson committed Nov 27, 2019
1 parent 02046ca commit 579beb2
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 2,695 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,2 +1,4 @@
.rts2*
package-lock.json
node_modules
dist
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -15,7 +15,7 @@

## About

Unlike other libraries, _Fielder_ has been built from the ground up with a **field-first** approach to validation.
_Fielder_ has been built from the ground up with a **field-first** approach to validation.

What does this mean?

Expand Down
2 changes: 0 additions & 2 deletions dist/context.js

This file was deleted.

4 changes: 0 additions & 4 deletions dist/index.js

This file was deleted.

52 changes: 0 additions & 52 deletions dist/provider.js

This file was deleted.

52 changes: 0 additions & 52 deletions dist/provider.jsx

This file was deleted.

Empty file removed dist/types.js
Empty file.
52 changes: 0 additions & 52 deletions dist/useField.js

This file was deleted.

9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -15,8 +15,9 @@
"validation"
],
"scripts": {
"start": "rollup -c rollup.config.js --watch",
"test": "jest",
"build": "microbundle build"
"build": "rollup -c rollup.config.js"
},
"repository": {
"type": "git",
Expand All @@ -39,10 +40,14 @@
"enzyme-adapter-react-16": "^1.15.1",
"jest": "^24.9.0",
"prettier": "^1.19.1",
"microbundle": "^0.11.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rollup": "^1.27.5",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-typescript2": "^0.25.2",
"ts-jest": "^24.2.0",
"tslib": "^1.10.0",
"typescript": "^3.7.2",
"yup": "^0.27.0"
},
Expand Down
36 changes: 36 additions & 0 deletions rollup.config.js
@@ -0,0 +1,36 @@
import typescript from "rollup-plugin-typescript2";
import { terser } from "rollup-plugin-terser";
import pkg from "./package.json";

export default {
input: "src/index.ts",
output: [
{
file: pkg.main,
format: "cjs",
sourcemap: true
},
{
file: pkg.module,
format: "es",
sourcemap: true
},
{
file: pkg["umd:main"],
format: "umd",
sourcemap: true,
name: "fielder",
globals: "react"
}
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {})
],
plugins: [
typescript(),
terser({
sourcemap: true
})
]
};
11 changes: 6 additions & 5 deletions tsconfig.json
@@ -1,16 +1,17 @@
{
"compilerOptions": {
"target": "esnext",
"target": "es2015",
"module": "esnext",
"moduleResolution": "node",
"lib": ["dom", "es2015", "esnext"],
"lib": ["dom", "es2015"],
"jsx": "react",
"strict": true,
"isolatedModules": true,
"esModuleInterop": true,
"keyofStringsOnly": true,
"outDir": "example/src/dist"
"outDir": "dist",
"declaration": true,
"sourceMap": true
},
"files": ["src/index.ts"],
"includes": ["src/**/*.tsx", "src/**/*.ts"]
"files": ["src/index.ts"]
}

0 comments on commit 579beb2

Please sign in to comment.