Skip to content

Commit

Permalink
Add comments in Node-specific files clarifying that they are replaced…
Browse files Browse the repository at this point in the history
… by Rollup when bundling for browsers (#7480)
  • Loading branch information
ryanhamley authored Oct 25, 2018
1 parent 42d1a5a commit 06c7c8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shaders/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// This file is intended for use in the GL-JS test suite
// It provides the shaders entry point for Node (tests and GL Native)
// In a browser environment, this file is replaced with ./src/shaders/shaders.js
// when Rollup builds the main bundle.
// See https://github.com/mapbox/mapbox-gl-js/blob/master/package.json#L104-L108

// Shaders entry point for Node (tests and GL Native)
/* eslint-disable import/unambiguous, import/no-commonjs, flowtype/require-valid-file-annotation, no-global-assign */

const fs = require('fs');
Expand Down
6 changes: 6 additions & 0 deletions src/util/web_worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// @flow

// This file is intended for use in the GL-JS test suite
// It implements a MessageBus main thread interface for use in Node environments
// In a browser environment, this file is replaced with ./src/util/browser/web_worker.js
// when Rollup builds the main bundle.
// See https://github.com/mapbox/mapbox-gl-js/blob/master/package.json#L104-L108

import Worker from '../source/worker';

import type {WorkerSource} from '../source/worker_source';
Expand Down
6 changes: 6 additions & 0 deletions src/util/window.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// @flow

// This file is intended for use in the GL-JS test suite
// It implements a JSDOM window object for use in Node environments
// In a browser environment, this file is replaced with ./src/util/browser/window.js
// when Rollup builds the main bundle
// See https://github.com/mapbox/mapbox-gl-js/blob/master/package.json#L104-L108

import jsdom from 'jsdom';

import gl from 'gl';
Expand Down

0 comments on commit 06c7c8f

Please sign in to comment.