Skip to content

Commit

Permalink
style: update code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Tao Zeng committed Jun 20, 2019
1 parent 9cba7b9 commit 52753de
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
'max-depth': [ON, 3],
'max-len': [1, 120, 4, { ignoreUrls: YES, ignoreRegExpLiterals: YES }],
'max-lines-per-function': [ON, { max: 25, skipBlankLines: YES, skipComments: YES }],
'max-lines': ON,
'max-lines': OFF,
'max-nested-callbacks': [ON, 3], // default is 10
'max-params': [ON, 3],
'max-statements': [ON, 12],
Expand Down
18 changes: 14 additions & 4 deletions index.js

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

2 changes: 1 addition & 1 deletion index.js.map

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

20 changes: 15 additions & 5 deletions src/proc-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,21 @@ const procFile = function (fname, options, code) {
}
// Ignore non-string sources
return typeof source === 'string'
? jscc(source, fname, _getJsccOpts(options))
: source
}).then(ret =>{
if(ret.map) {
ret.map.sources[0] = fname
? jscc(source, fname, _getJsccOpts(options))
: source
}).then((ret) => {
/*
change the relative source path in the source map to the input file path
explanation:
rollup will resolve source path through the file's directory absolute path
and the source path in the returned source map by the plugin
new Source(resolve(dirname(module.id), originalSourcemap.sourceRoot || '.', source), sourcesContent[i])
@see https://github.com/rollup/rollup/blob/v1.15.6/src/utils/collapseSourcemaps.ts#L196
*/
if (ret.map) {
ret.map.sources[0] = fname
}
return ret
})
Expand Down
Loading

0 comments on commit 52753de

Please sign in to comment.