Beta-Seite hinzugefügt
This commit is contained in:
parent
b0287f5db0
commit
e61097cfc4
36
bin/build.js
36
bin/build.js
@ -6,10 +6,12 @@ const fs = require('fs');
|
|||||||
|
|
||||||
var uglifyJs = null;
|
var uglifyJs = null;
|
||||||
var babel = null;
|
var babel = null;
|
||||||
|
var regenerator = null;
|
||||||
|
|
||||||
if (shouldMangleAndTranspile) {
|
if (shouldMangleAndTranspile) {
|
||||||
uglifyJs = require('uglify-es');
|
uglifyJs = require('uglify-es');
|
||||||
babel = require('babel-core');
|
babel = require('babel-core');
|
||||||
|
regenerator = require('regenerator');
|
||||||
}
|
}
|
||||||
const uglifyOptions = {
|
const uglifyOptions = {
|
||||||
ecma: "es6",
|
ecma: "es6",
|
||||||
@ -22,20 +24,20 @@ const uglifyOptions = {
|
|||||||
},
|
},
|
||||||
// toplevel: true
|
// toplevel: true
|
||||||
},
|
},
|
||||||
compress: {
|
// compress: {
|
||||||
ecma: "es6",
|
// ecma: "es6",
|
||||||
keep_fargs: false,
|
// keep_fargs: false,
|
||||||
toplevel: true,
|
// toplevel: true,
|
||||||
dead_code: true,
|
// dead_code: true,
|
||||||
unused: true,
|
// unused: true,
|
||||||
passes: 1,
|
// passes: 1,
|
||||||
},
|
// },
|
||||||
// sourceMap:{
|
// sourceMap:{
|
||||||
// url:"inline"
|
// url:"inline"
|
||||||
// },
|
// },
|
||||||
// output: {
|
output: {
|
||||||
// beautify: true
|
beautify: true
|
||||||
// }
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const babelOptions = {
|
const babelOptions = {
|
||||||
@ -43,7 +45,12 @@ const babelOptions = {
|
|||||||
minified: true,
|
minified: true,
|
||||||
presets: ['env'],
|
presets: ['env'],
|
||||||
// sourceMaps:"inline",
|
// sourceMaps:"inline",
|
||||||
// plugins: [["minify-mangle-names", {topLevel: true}], "transform-class-properties"]
|
// plugins: ["regenerator-runtime"]
|
||||||
|
};
|
||||||
|
|
||||||
|
const regeneratorOptions = {
|
||||||
|
includeRuntime: true,
|
||||||
|
// sourceMaps:"inline",
|
||||||
};
|
};
|
||||||
|
|
||||||
const options = require('../rollup.config');
|
const options = require('../rollup.config');
|
||||||
@ -62,13 +69,16 @@ async function build() {
|
|||||||
fs.writeFileSync('transpiled.js', code);
|
fs.writeFileSync('transpiled.js', code);
|
||||||
const babelRes = babel.transform(code, babelOptions);
|
const babelRes = babel.transform(code, babelOptions);
|
||||||
code = babelRes.code;
|
code = babelRes.code;
|
||||||
|
code = regenerator.compile(code, regeneratorOptions).code;
|
||||||
const uglifyRes2 = uglifyJs.minify(code, {mangle:{toplevel:true},compress: {
|
const uglifyRes2 = uglifyJs.minify(code, {mangle:{toplevel:true},compress: {
|
||||||
keep_fargs: false,
|
keep_fargs: false,
|
||||||
toplevel: true,
|
toplevel: true,
|
||||||
dead_code: true,
|
dead_code: true,
|
||||||
unused: true,
|
unused: true,
|
||||||
passes: 1,
|
passes: 1,
|
||||||
},});
|
|
||||||
|
},
|
||||||
|
});
|
||||||
code = uglifyRes2.code;
|
code = uglifyRes2.code;
|
||||||
}
|
}
|
||||||
fs.writeFileSync(outputOptions[i].file, code);
|
fs.writeFileSync(outputOptions[i].file, code);
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
npm run build
|
npm run build 1
|
||||||
@ -20,6 +20,7 @@
|
|||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.6.1",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"babel-preset-latest": "^6.24.1",
|
"babel-preset-latest": "^6.24.1",
|
||||||
|
"regenerator": "^0.13.2",
|
||||||
"rollup": "^0.57.1",
|
"rollup": "^0.57.1",
|
||||||
"rollup-plugin-babel": "^3.0.3",
|
"rollup-plugin-babel": "^3.0.3",
|
||||||
"uglify-es": "^3.3.9"
|
"uglify-es": "^3.3.9"
|
||||||
|
|||||||
5609
public/js/app.js
5609
public/js/app.js
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@ export class FourWordsLevel extends Level {
|
|||||||
leafsWords[3] = Level._createLeafsForWord(this.words[3], this.templateContainer.copyLeafTemplate());
|
leafsWords[3] = Level._createLeafsForWord(this.words[3], this.templateContainer.copyLeafTemplate());
|
||||||
|
|
||||||
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
|
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
|
||||||
for (let i = 0, n = this.wordLength / 4; i < n; i++) {
|
for (let i = 0; i < this.wordLength / 4; i++) {
|
||||||
|
|
||||||
let parents = [];
|
let parents = [];
|
||||||
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
|
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export class SixWordsRowLevel extends Level {
|
|||||||
leafsWords[5] = Level._createLeafsForWord(this.words[5], this.templateContainer.copyLeafTemplate());
|
leafsWords[5] = Level._createLeafsForWord(this.words[5], this.templateContainer.copyLeafTemplate());
|
||||||
|
|
||||||
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
|
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
|
||||||
for (let i = 0, n = this.wordLength / 4; i < n; i++) {
|
for (let i = 0; i < this.wordLength / 4; i++) {
|
||||||
|
|
||||||
let parents = [];
|
let parents = [];
|
||||||
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
|
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user