Skip to content

Commit

Permalink
Improved flow sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Feb 23, 2018
1 parent 6b43ad0 commit e035847
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
"rollup-plugin-browserify-transform": "^1.0.1",
"rollup-plugin-buble": "^0.18.0",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-flow": "^1.1.1",
"rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^3.0.0",
Expand Down
16 changes: 14 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import flow from 'rollup-plugin-flow';
import flowRemoveTypes from 'flow-remove-types';
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
Expand All @@ -15,7 +15,7 @@ const outputFile = production ? 'dist/mapbox-gl.js' : 'dist/mapbox-gl-dev.js';

const plugins = [
sourcemaps(),
flow({pretty: true}), // setting {pretty: true} works around https://github.com/leebyron/rollup-plugin-flow/issues/5
flow(), // setting {pretty: true} works around https://github.com/leebyron/rollup-plugin-flow/issues/5
minifyStyleSpec(),
json(),
buble({transforms: {dangerousForOf: true}, objectAssign: "Object.assign"}),
Expand Down Expand Up @@ -73,4 +73,16 @@ if (!shared) {
`
}];

// Using this instead of rollup-plugin-flow due to
// https://github.com/leebyron/rollup-plugin-flow/issues/5
function flow() {
return {
name: 'flow-remove-types',
transform: (code, id) => ({
code: flowRemoveTypes(code).toString(),
map: null
})
};
}

export default config
20 changes: 1 addition & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3760,10 +3760,6 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"

estree-walker@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e"

estree-walker@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa"
Expand Down Expand Up @@ -4112,7 +4108,7 @@ flow-coverage-report@^0.3.0:
terminal-table "0.0.12"
yargs "5.0.0"

flow-remove-types@^1.0.4, flow-remove-types@^1.1.0, flow-remove-types@^1.1.2:
flow-remove-types@^1.0.4, flow-remove-types@^1.1.2:
version "1.2.3"
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-1.2.3.tgz#6131aefc7da43364bb8b479758c9dec7735d1a18"
dependencies:
Expand Down Expand Up @@ -8610,13 +8606,6 @@ rollup-plugin-commonjs@^8.2.6:
resolve "^1.4.0"
rollup-pluginutils "^2.0.1"

rollup-plugin-flow@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-flow/-/rollup-plugin-flow-1.1.1.tgz#6ce568f1dd559666b77ab76b4bae251407528db6"
dependencies:
flow-remove-types "^1.1.0"
rollup-pluginutils "^1.5.1"

rollup-plugin-json@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.3.0.tgz#3c07a452c1b5391be28006fbfff3644056ce0add"
Expand Down Expand Up @@ -8656,13 +8645,6 @@ rollup-plugin-unassert@^0.2.0:
rollup-pluginutils "^2.0.1"
unassert "^1.5.1"

rollup-pluginutils@^1.5.1:
version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
dependencies:
estree-walker "^0.2.1"
minimatch "^3.0.2"

rollup-pluginutils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0"
Expand Down

0 comments on commit e035847

Please sign in to comment.