parent
5c8aa9c157
commit
e3a0472e3c
|
@ -57,6 +57,7 @@
|
|||
"ui/@build/jsProject",
|
||||
"ui/@build/tsProject",
|
||||
"ui/@build/tsPlugins",
|
||||
"ui/@build/rollupProject",
|
||||
"ui/@types/lichess"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
const resolve = require('@rollup/plugin-node-resolve').default;
|
||||
const commonjs = require('@rollup/plugin-commonjs');
|
||||
const typescript = require('@rollup/plugin-typescript');
|
||||
const terser = require('rollup-plugin-terser').terser;
|
||||
|
||||
exports.rollupProject = (targets) => {
|
||||
return (args) => {
|
||||
const prod = args['config-prod'];
|
||||
const target = targets[args['config-plugin'] || 'main'];
|
||||
return {
|
||||
input: target.input,
|
||||
output: [
|
||||
prod ? {
|
||||
file: `../../public/compiled/${target.output}.min.js`,
|
||||
format: 'iife',
|
||||
name: target.name,
|
||||
plugins: [
|
||||
terser({
|
||||
output: {
|
||||
safari10: true,
|
||||
comments: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
} : {
|
||||
file: `../../public/compiled/${target.output}.js`,
|
||||
format: 'iife',
|
||||
name: target.name,
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
resolve(),
|
||||
typescript(),
|
||||
commonjs({
|
||||
extensions: ['.js', '.ts'],
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "@build/rollupProject",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"author": "Thibault Duplessis",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-commonjs": "^13.0.0",
|
||||
"@rollup/plugin-node-resolve": "^8.1.0",
|
||||
"@rollup/plugin-typescript": "^5.0.1",
|
||||
"rollup": "^2.18.1",
|
||||
"rollup-plugin-terser": "^6.1.0",
|
||||
"tslib": "^2.0.0",
|
||||
"typescript": "^3.9.5"
|
||||
}
|
||||
}
|
|
@ -14,8 +14,7 @@
|
|||
"author": "Thibault Duplessis",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@build/tsPlugins": "2.0.0",
|
||||
"@build/tsProject": "2.0.0",
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/jquery": "^2.0",
|
||||
"@types/lichess": "2.0.0"
|
||||
},
|
||||
|
@ -33,7 +32,7 @@
|
|||
"tree": "2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "gulp dev",
|
||||
"prod": "gulp prod"
|
||||
"dev": "rollup --config",
|
||||
"prod": "rollup --config --config-prod && rollup --config --config-prod --config-plugin nvui"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import { rollupProject } from '@build/rollupProject';
|
||||
|
||||
export default rollupProject({
|
||||
main: {
|
||||
name: 'LichessAnalyse',
|
||||
input: 'src/main.ts',
|
||||
output: 'lichess.analyse',
|
||||
},
|
||||
nvui: {
|
||||
input: 'src/plugins/nvui.ts',
|
||||
output: 'lichess.analyse.nvui',
|
||||
},
|
||||
});
|
|
@ -2,7 +2,7 @@ import { prop } from 'common';
|
|||
import { storedProp } from 'common/storage';
|
||||
import { opposite } from 'chessground/util';
|
||||
import { controller as configCtrl } from './explorerConfig';
|
||||
import xhr = require('./explorerXhr');
|
||||
import * as xhr from './explorerXhr';
|
||||
import { winnerOf, colorOf } from './explorerUtil';
|
||||
import * as gameUtil from 'game';
|
||||
import AnalyseCtrl from '../ctrl';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { h } from 'snabbdom'
|
||||
import { VNode } from 'snabbdom/vnode'
|
||||
import studyView = require('../study/studyView');
|
||||
import * as studyView from '../study/studyView';
|
||||
import { nodeFullName, bind } from '../util';
|
||||
import AnalyseCtrl from '../ctrl';
|
||||
import { patch } from '../main';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"include": ["src/*.ts", "src/*.js"],
|
||||
"include": ["src/**/*.ts", "src/**/*.js"],
|
||||
"compilerOptions": {
|
||||
"allowJs": false,
|
||||
"noImplicitAny": false,
|
||||
|
|
|
@ -13,14 +13,9 @@
|
|||
"author": "Thibault Duplessis",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^13.0.0",
|
||||
"@rollup/plugin-node-resolve": "^8.1.0",
|
||||
"@rollup/plugin-typescript": "^5.0.0",
|
||||
"@build/rollupProject": "2.0.0",
|
||||
"@types/jquery": "^2.0",
|
||||
"@types/lichess": "2.0.0",
|
||||
"rollup": "^2.18.1",
|
||||
"rollup-plugin-terser": "^6.1.0",
|
||||
"typescript": "^3.9.5"
|
||||
"@types/lichess": "2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ceval": "2.0.0",
|
||||
|
@ -28,7 +23,6 @@
|
|||
"chessops": "^0.5.0",
|
||||
"common": "2.0.0",
|
||||
"snabbdom": "^0.7.4",
|
||||
"tslib": "^2.0.0",
|
||||
"tree": "2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -1,36 +1,9 @@
|
|||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import { rollupProject } from '@build/rollupProject';
|
||||
|
||||
export default args => {
|
||||
return {
|
||||
export default rollupProject({
|
||||
main: {
|
||||
name: 'LichessPuzzle',
|
||||
input: 'src/main.ts',
|
||||
output: [
|
||||
args['config-prod'] ? {
|
||||
file: '../../public/compiled/lichess.puzzle.min.js',
|
||||
format: 'iife',
|
||||
name: 'LichessPuzzle',
|
||||
plugins: [
|
||||
terser({
|
||||
output: {
|
||||
safari10: true,
|
||||
comments: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
} : {
|
||||
file: '../../public/compiled/lichess.puzzle.js',
|
||||
format: 'iife',
|
||||
name: 'LichessPuzzle',
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
resolve(),
|
||||
typescript(),
|
||||
commonjs({
|
||||
extensions: ['.js', '.ts'],
|
||||
}),
|
||||
]
|
||||
};
|
||||
}
|
||||
output: 'lichess.puzzle',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -73,10 +73,10 @@
|
|||
is-module "^1.0.0"
|
||||
resolve "^1.14.2"
|
||||
|
||||
"@rollup/plugin-typescript@^5.0.0":
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-5.0.0.tgz#4e7f9d8c32dfa144bf090c6a69105d32c76381af"
|
||||
integrity sha512-ixgeJXTBArPyJnjP85/8SLYJrPdbOmpRqJ5ICmDERrHAKtiVejl4ybqpw/bEtwycOdBlRH3BaePMTavLt+afVA==
|
||||
"@rollup/plugin-typescript@^5.0.1":
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-5.0.1.tgz#af1cb238e4821e9e371cb00b10a7f61f282fca5b"
|
||||
integrity sha512-r2rfyh7dFfqHwxkITM/I9sW+rkx66/ycr12msvZliU6AX1plIcRq4lU9crcQbcSjMr7T9ONWM6pAwsBiNAYW8g==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.1"
|
||||
resolve "^1.14.1"
|
||||
|
|
Loading…
Reference in New Issue