Skip to content

Commit

Permalink
fix sourcemap generation and watching
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Aug 7, 2019
1 parent 9443b99 commit 234cb9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"native-promise-only": "^0.8.1",
"rollup": "1.8.0",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-commonjs": "^9.0.0",
"rollup-plugin-includepaths": "^0.2.3",
"rollup-plugin-multi-entry": "github:arshaw/rollup-plugin-multi-entry#dist",
Expand Down
5 changes: 5 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const commonjs = require('rollup-plugin-commonjs')
const multiEntry = require('rollup-plugin-multi-entry')
const sourcemaps = require('rollup-plugin-sourcemaps')
const alias = require('rollup-plugin-alias')
const cleanup = require('rollup-plugin-cleanup')
const handleBars = require('handlebars')
const { pkgStructs } = require('./scripts/lib/pkg-struct')

Expand Down Expand Up @@ -82,6 +83,10 @@ function buildPkgConfig(pkgStruct, ownBrowserGlobals, isDev) {

if (isDev) {
plugins.push(sourcemaps())

// HACK: there's a bug with sourcemap reading and watching: the first rebuild includes the intermediate
// sourceMappingURL comments, confusing consumers of the generated sourcemap. Forcefully remove these comments.
plugins.push(cleanup({ comments: 'none' }))
}

return {
Expand Down

0 comments on commit 234cb9f

Please sign in to comment.