Skip to content

Create vendor folder and fresh dist as a target only without extras including mathjax #5487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ jobs:
environment:
NODE_OPTIONS: --max_old_space_size=4096
command: npm run no-dup-keys
- run:
name: Test plotly.min.js import using requirejs
command: npm run test-requirejs

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ vendor
dist
build

tasks/test_requirejs.js
test/jasmine/assets/jquery-1.8.3.min.js
src/plots/polar/legacy/micropolar.js
209 changes: 209 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"test-export": "node tasks/test_export.js",
"test-syntax": "node tasks/test_syntax.js && npm run find-strings -- --no-output",
"test-bundle": "node tasks/test_bundle.js",
"test-requirejs": "node tasks/test_requirejs.js",
"test": "npm run test-jasmine -- --nowatch && npm run test-bundle && npm run test-image && npm run test-export && npm run test-syntax && npm run lint",
"start-test_dashboard": "node devtools/test_dashboard/server.js",
"start-image_viewer": "node devtools/image_viewer/server.js",
Expand Down Expand Up @@ -132,6 +133,7 @@
"browserify": "^17.0.0",
"browserify-transform-tools": "^1.7.0",
"bubleify": "^2.0.0",
"canvas": "^2.6.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"check-node-version": "^4.0.3",
"chttps": "^1.0.6",
"deep-equal": "^2.0.5",
Expand Down
28 changes: 28 additions & 0 deletions tasks/test_requirejs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var JSDOM = require('jsdom').JSDOM;
global.document = new JSDOM('<!DOCTYPE html><head></head><html><body></body></html>').window.document;
global.window = document.defaultView;
global.window.document = global.document;
global.self = global.window;
global.Blob = global.window.Blob;
global.DOMParser = global.window.DOMParser;
global.getComputedStyle = global.window.getComputedStyle;
global.window.URL.createObjectURL = function() {};

// see: Building node modules with AMD or RequireJS https://requirejs.org/docs/node.html
if(typeof define !== 'function') {
var define = require('amdefine')(module);
}

define(function(require) {
var plotly = require('../dist/plotly.min.js');

if(plotly) {
console.log(plotly);
} else {
console.error('Error: loading with requirejs');
}

// The value returned from the function is
// used as the module export visible to Node.
return function() {};
});