This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
131 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,6 @@ typings/ | |
# next.js build output | ||
.next | ||
|
||
dist/ | ||
dist/ | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "6" | ||
- "8" | ||
- "10" | ||
- "latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
///@ts-check | ||
"use strict"; | ||
var gulp = require("gulp"); | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
var compileJs = require("../compiler/compile-javascript"); | ||
var unlink = require("../lib/unlink"); | ||
var extToGlob = require("../lib/ext-to-glob"); | ||
var watchLog = require("../log/watch"); | ||
|
||
var JS_EXTS = ["js", "wxs"]; | ||
/** | ||
* @param {object} config | ||
*/ | ||
exports.build = function (config) { | ||
return function () { | ||
return compileJs(config, extToGlob(config, JS_EXTS)); | ||
}; | ||
}; | ||
|
||
|
||
/** | ||
* @param {object} config | ||
*/ | ||
exports.watch = function (config) { | ||
return function (cb) { | ||
var glob = extToGlob(config, JS_EXTS); | ||
watchLog("js", glob); | ||
gulp.watch(glob) | ||
.on("change", function (file) { | ||
return compileJs(config, file); | ||
}) | ||
.on("add", function (file) { | ||
return compileJs(config, file); | ||
}) | ||
.on("unlink", unlink(config.src, config.dist, ".js")); | ||
cb && cb(); | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
///@ts-check | ||
"use strict"; | ||
var gulp = require("gulp"); | ||
var fs = require("fs"); | ||
|
||
var log = require('fancy-log'); | ||
var colors = require('ansi-colors'); | ||
|
||
var compileTs = require("../compiler/compile-typescript"); | ||
var unlink = require("../lib/unlink"); | ||
var extToGlob = require("../lib/ext-to-glob"); | ||
var watchLog = require("../log/watch"); | ||
|
||
var TS_EXTS = ["ts"]; | ||
/** | ||
* @param {object} config | ||
*/ | ||
exports.build = function (config) { | ||
if (config.tsconfig || fs.existsSync("tsconfig.json")) { | ||
return function () { | ||
config.tsconfig = config.tsconfig || "tsconfig.json"; | ||
return compileTs(config); | ||
} | ||
} else { | ||
log( | ||
colors.cyan('npm:'), | ||
colors.gray('`tsconfig.json` was found. Skip typescript compilation!'), | ||
); | ||
return function (cb) { | ||
cb && cb(); | ||
} | ||
} | ||
}; | ||
|
||
/** | ||
* @param {object} config | ||
*/ | ||
exports.watch = function (config) { | ||
return function (cb) { | ||
var glob = extToGlob(config, TS_EXTS); | ||
watchLog("js", glob); | ||
gulp.watch(glob, { | ||
ignored: config.src + "/*/**.d.ts", | ||
}) | ||
.on("change", function (file) { | ||
return compileTs(config, file); | ||
}) | ||
.on("add", function (file) { | ||
return compileTs(config, file); | ||
}) | ||
.on("unlink", unlink(config.src, config.dist, ".js")); | ||
cb && cb(); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters