Webpack support
See original GitHub issueI tried bundling Plotly with Webpack but couldn’t be able to do it. I created a plotly.bundle.js file and added Plotly modules that I need to that custom module.
var plotlyCore = require(__dirname +'/app/static/components/plotly.js/lib/core');
plotlyCore.register([
require(__dirname +'/app/static/components/plotly.js/lib/pie'),
require(__dirname +'/app/static/components/plotly.js/lib/choropleth'),
require(__dirname +'/app/static/components/plotly.js/lib/bar'),
require(__dirname +'/app/static/components/plotly.js/lib/heatmap'),
require(__dirname +'/app/static/components/plotly.js/lib/histogram'),
require(__dirname +'/app/static/components/plotly.js/lib/scatter'),
]);
module.exports = plotlyCore;
Then added ify loader using this configuration:
{test: /node_modules/, loader: 'ify'}
When I try to run webpack command it throws this exception:
ERROR in ../components/plotly.js/src/core.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/ploticon in /Users/buremba/Code/rakam-ui/app/static/components/plotly.js/src
@ ../components/plotly.js/src/core.js 35:16-44
ERROR in ../components/plotly.js/src/plotly.js
Module not found: Error: Cannot resolve module 'es6-promise' in /Users/buremba/Code/rakam-ui/app/static/components/plotly.js/src
@ ../components/plotly.js/src/plotly.js 22:0-22
ERROR in ../components/plotly.js/src/plotly.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/plotcss in /Users/buremba/Code/rakam-ui/app/static/components/plotly.js/src
@ ../components/plotly.js/src/plotly.js 30:0-27
ERROR in ../components/plotly.js/src/traces/bar/set_positions.js
Module not found: Error: Cannot resolve module 'fast-isnumeric' in /Users/buremba/Code/rakam-ui/app/static/components/plotly.js/src/traces/bar
@ ../components/plotly.js/src/traces/bar/set_positions.js 12:16-41
ERROR in ../components/plotly.js/src/traces/bar/calc.js
Module not found: Error: Cannot resolve module 'fast-isnumeric' in /Users/buremba/Code/rakam-ui/app/static/components/plotly.js/src/traces/bar
@ ../components/plotly.js/src/traces/bar/calc.js 12:16-41
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >webpack.js.org - GitHub
Webpack supports ES2015+, CommonJS and AMD modules out of the box. It performs clever static analysis on the AST of your code. It...
Read more >Getting Started With Webpack - Smashing Magazine
Modern browsers provide good support for JavaScript modules, ... Webpack supports modules created using the ES6, CommonJS and AMD syntax.
Read more >What is Webpack - SurviveJS
Webpack supports ES2015, CommonJS, MJS, and AMD module formats out of the box. There's also support for WebAssembly, a new way of running...
Read more >Supported technologies: Webpack - Wallaby.js
Wallaby.js Supported technologies: Webpack. ... This documentation page describes the wallaby-webpack postprocessor, if you're interested in how to use the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
see https://github.com/plotly/plotly.js/blob/master/README.md#building-plotlyjs-with-webpack for recent instructions
@mdramos you can now use the individual modules that you need from the
plotly.js/lib
and create a more lean bundle that suits your needs. e.g.Then, elsewhere in your code you can require this file and use Plotly as you would normally.
https://github.com/plotly/plotly.js#modules