Skip to content

Commit 7eb017a

Browse files
committed
fix(*): compile with rollup
1 parent 286d72e commit 7eb017a

6 files changed

+107
-14
lines changed

lib/StickyElement.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { TRenderChildren } from './types';
3-
import shallowEqual from 'recompose/shallowEqual';
3+
import { shallowEqual } from 'recompose';
44

55
interface IProps<R> {
66
disabled: boolean;

lib/StickyProvider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { ViewportProvider } from 'react-viewport-utils';
3-
import wrapDisplayName from 'recompose/wrapDisplayName';
3+
import { wrapDisplayName } from 'recompose';
44
import { IStickyInjectedProps } from './types';
55

66
const StickyGroupContext = React.createContext({

package-lock.json

+71-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"version": "1.0.0",
44
"description": "React components for sophisticated sticky behavior",
55
"main": "dist/index.js",
6-
"typings": "./dist/index.d.ts",
6+
"module": "dist/index.es.js",
7+
"typings": "dist/index.d.ts",
78
"scripts": {
89
"start": "rm -rf ./.cache && parcel ./examples/index.html --out-dir='examples-dist'",
910
"compile:docs": "rm -rf docs && parcel build ./examples/index.html ./examples/legacy-browsers.html --out-dir='docs' --public-url=\"https://garthenweb.github.io/react-stickup/\"",
1011
"precompile": "rm -rf dist",
11-
"compile": "tsc --project ./tsconfig.json",
12+
"compile": "rollup -c",
1213
"test": "jest lib",
1314
"fmt": "prettier --write \"lib/*.{ts,tsx}\" \"examples/*.{ts,tsx}\"",
1415
"prepublishOnly": "npm run compile",
@@ -41,6 +42,8 @@
4142
"prettier": "^1.14.2",
4243
"react": "^16.4.2",
4344
"react-dom": "^16.4.2",
45+
"rollup": "^0.66.0",
46+
"rollup-plugin-typescript2": "^0.17.0",
4447
"ts-jest": "^23.1.4",
4548
"typescript": "^3.0.1"
4649
},

rollup.config.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import typescript from 'rollup-plugin-typescript2';
2+
import pkg from './package.json';
3+
export default {
4+
input: 'lib/index.ts',
5+
output: [
6+
{
7+
file: pkg.main,
8+
format: 'cjs',
9+
},
10+
{
11+
file: pkg.module,
12+
format: 'es',
13+
},
14+
],
15+
external: [
16+
...Object.keys(pkg.dependencies || {}),
17+
...Object.keys(pkg.peerDependencies || {}),
18+
],
19+
plugins: [
20+
typescript({
21+
typescript: require('typescript'),
22+
}),
23+
],
24+
};

tsconfig.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
{
22
"compilerOptions": {
3-
"outDir": "dist",
4-
"module": "commonjs",
3+
"declaration": true,
4+
"declarationDir": "./dist",
5+
"module": "es6",
6+
"outDir": "./dist",
57
"target": "es5",
68
"lib": ["es6", "dom"],
79
"sourceMap": true,
810
"jsx": "react",
9-
"moduleResolution": "node",
10-
"rootDir": "lib",
11-
"declaration": true,
1211
"forceConsistentCasingInFileNames": true,
1312
"noImplicitReturns": true,
1413
"noImplicitThis": true,
1514
"noImplicitAny": true,
1615
"suppressImplicitAnyIndexErrors": true,
1716
"noUnusedLocals": true,
18-
"experimentalDecorators": true
19-
17+
"allowSyntheticDefaultImports": true
2018
},
2119
"include": [
2220
"lib/**/*"

0 commit comments

Comments
 (0)