From 7e35c92c2c011295e0b55cd93ee87d4e5a491ba4 Mon Sep 17 00:00:00 2001 From: Elijah Meeks Date: Wed, 20 Mar 2019 17:33:02 -0700 Subject: [PATCH] Fix rollup --- rollup.config.js | 28 ++++++++++++++++++++------- src/components/AnnotationLayer.tsx | 2 +- src/components/VisualizationLayer.tsx | 4 +++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 676ba4f9..7355b5a2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -24,13 +24,6 @@ export default { plugins: [ typescript(), node({ jsnext: true, preferBuiltins: false }), - babel({ - babelrc: false, - runtimeHelpers: true, - presets: ["@babel/react"], - plugins: ["@babel/external-helpers"] - }), - nodent({ includeruntime: true, sourcemap: false }), builtins(), commonjs({ include: "node_modules/**", @@ -44,6 +37,27 @@ export default { ] } }), + babel({ + babelrc: false, + runtimeHelpers: true, + presets: [ + "@babel/react", + [ + "@babel/preset-env", + { + modules: false + } + ] + ], + plugins: [ + ["@babel/plugin-proposal-class-properties"], + "@babel/external-helpers", + ["@babel/plugin-proposal-decorators", { legacy: true }], + "@babel/plugin-transform-object-assign", + "react-require" + ] + }), + nodent({ includeruntime: true, sourcemap: false }), replace({ "process.env.NODE_ENV": '"production"' }) diff --git a/src/components/AnnotationLayer.tsx b/src/components/AnnotationLayer.tsx index c5be999c..47fdf235 100644 --- a/src/components/AnnotationLayer.tsx +++ b/src/components/AnnotationLayer.tsx @@ -5,7 +5,7 @@ import { bumpAnnotations } from "./annotationLayerBehavior/annotationHandling" import Legend from "./Legend" import Annotation from "./Annotation" -import labella from "labella" +import * as labella from "labella" import SpanOrDiv from "./SpanOrDiv" import { AnnotationHandling, diff --git a/src/components/VisualizationLayer.tsx b/src/components/VisualizationLayer.tsx index e66ba5d4..c05f7246 100644 --- a/src/components/VisualizationLayer.tsx +++ b/src/components/VisualizationLayer.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { RoughCanvas } from "roughjs-es5/lib/canvas" +import * as Rough from "roughjs-es5/lib/canvas" import { chuckCloseCanvasTransform } from "./canvas/basicCanvasEffects" @@ -10,6 +10,8 @@ import { VizLayerTypes } from "./types/generalTypes" +const RoughCanvas = Rough.RoughCanvas + type Props = { axes?: Array frameKey?: string