TS
npm install --save-dev @types/plotly.js'
yarn add --dev @types/plotly.js'
import { PlotData } from "plotly.js";
on't @types , .
plotly.js, plotly.js . , , .. Reaction-plotly + plotly.js âđïļ
, React , , - .
, Webpack 4 response-plotly + plotly.js-basic-dist.
:
.
, .
...
, , ,
import Plotly from "plotly.js-basic-dist";
import createPlotlyComponent from "react-plotly.js/factory";
const Plot = createPlotlyComponent(Plotly);
FIX
@types

typeRoots tsconfig.json

N.B. , , :

, !
UPDATE
. - , response-plotly.js "". :
function makeVendorEntry(config) {
const packageJson = require('../package.json');
const vendorDependencies = Object.keys(packageJson['dependencies']);
const vendorModulesMinusExclusions = vendorDependencies.filter(vendorModule =>
config.mainModules.indexOf(vendorModule) === -1 && config.modulesToExclude.indexOf(vendorModule) === -1);
return vendorModulesMinusExclusions;
}
exports.makeVendorEntry = makeVendorEntry;
Hide resultreact-plotly.js devDependencies, .