-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
3,121 additions
and
3,299 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "5" | ||
- "6" | ||
- "7" | ||
- "8" | ||
- "9" | ||
- "10" | ||
- "11" | ||
- "12" | ||
- "13" |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
* Author: Yomguithereal (Guillaume Plique) | ||
* License: MIT | ||
*/ | ||
<%= code %> |
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,40 @@ | ||
var fs = require('fs-extra'), | ||
path = require('path'), | ||
browserify = require('browserify'), | ||
compileTemplate = require('lodash/template'), | ||
Terser = require('terser'); | ||
|
||
var pkg = require('../package.json'); | ||
|
||
var TEMPLATE_PATH = path.join(__dirname, 'banner.tmpl'); | ||
var ENPOINT_PATH = path.join(__dirname, '..', 'src', 'baobab.js'); | ||
|
||
var BUILD_PATH = path.join(__dirname, '..', 'build'); | ||
var CONCAT_PATH = path.join(BUILD_PATH, 'baobab.js'); | ||
var MINIFIED_PATH = path.join(BUILD_PATH, 'baobab.min.js'); | ||
|
||
var BANNER_TEMPLATE = compileTemplate(fs.readFileSync(TEMPLATE_PATH, 'utf-8')); | ||
|
||
browserify(ENPOINT_PATH, {standalone: 'Baobab'}) | ||
.transform('babelify', {presets: [['@babel/preset-env', {loose: true}]]}) | ||
.bundle(function(err, buffer) { | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
} | ||
|
||
fs.ensureDirSync(BUILD_PATH); | ||
|
||
var commonTemplateData = { | ||
name: 'Baobab', | ||
homepage: pkg.homepage, | ||
version: pkg.version | ||
}; | ||
|
||
var baobabCode = buffer.toString(); | ||
|
||
var minifiedCode = Terser.minify(baobabCode).code; | ||
|
||
fs.writeFileSync(CONCAT_PATH, BANNER_TEMPLATE(Object.assign({code: baobabCode}, commonTemplateData))); | ||
fs.writeFileSync(MINIFIED_PATH, BANNER_TEMPLATE(Object.assign({code: minifiedCode}, commonTemplateData))); | ||
}); |
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,3 @@ | ||
require('@babel/register')({ | ||
presets: ['@babel/preset-env'] | ||
}); |