Skip to content

Commit

Permalink
fix(source-map): remain the defulat source-map dir
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhaoju committed Jan 31, 2018
1 parent 37e6848 commit b08f232
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions lib/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ exports.run = function (options) {
var sourceMapPath = sysPath.join(this.cwd, typeof this.sourceMap === 'string' ? this.sourceMap : '.source-map');

var outputPath = config.output.path;
fs.ensureDirSync(sourceMapPath);
UtilFs.deleteFolderRecursive(sourceMapPath);
if (fs.existsSync(sourceMapPath)) {
UtilFs.deleteFolderRecursive(sourceMapPath, true);
} else {
fs.ensureDirSync(sourceMapPath);
}
recursiveMove(outputPath, sourceMapPath);

function recursiveMove(assetPath, distPath) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ykit",
"version": "2.3.0-rc.0",
"version": "2.3.0-rc.1",
"description": "现代 JavaScript 应用构建工具",
"bin": {
"ykit": "bin/ykit"
Expand Down
7 changes: 5 additions & 2 deletions src/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ exports.run = function(options) {
);

const outputPath = config.output.path;
fs.ensureDirSync(sourceMapPath);
UtilFs.deleteFolderRecursive(sourceMapPath);
if (fs.existsSync(sourceMapPath)) {
UtilFs.deleteFolderRecursive(sourceMapPath, true);
} else {
fs.ensureDirSync(sourceMapPath);
}
recursiveMove(outputPath, sourceMapPath);

function recursiveMove(assetPath, distPath) {
Expand Down

0 comments on commit b08f232

Please sign in to comment.