node版本回退

Signed-off-by: yy8545 <854551495@qq.com>
This commit is contained in:
yy8545 2024-07-29 17:06:15 +08:00
parent 72fb6d5a57
commit bcb6a3d39e
6 changed files with 7513 additions and 5676 deletions

View File

@ -51,7 +51,6 @@ action("gen_snapshot") {
babel = "//third_party/jsframework/.babelrc" babel = "//third_party/jsframework/.babelrc"
test_file = "//third_party/jsframework/test" test_file = "//third_party/jsframework/test"
css_what = "//third_party/css-what" css_what = "//third_party/css-what"
uglify_plugin_file = "//third_party/jsframework/rollup-plugin-uglifyjs.js"
args = [ args = [
rebase_path(nodejs_path, root_build_dir), rebase_path(nodejs_path, root_build_dir),
@ -67,7 +66,6 @@ action("gen_snapshot") {
rebase_path("//prebuilts", root_build_dir), rebase_path("//prebuilts", root_build_dir),
rebase_path(buildfile_native_min, root_build_dir), rebase_path(buildfile_native_min, root_build_dir),
rebase_path(css_what, root_build_dir), rebase_path(css_what, root_build_dir),
rebase_path(uglify_plugin_file, root_build_dir),
] ]
inputs = [ inputs = [

View File

@ -19,19 +19,21 @@ const path = require('path');
const rollup = require('rollup'); const rollup = require('rollup');
const resolve = require('@rollup/plugin-node-resolve'); const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs'); const commonjs = require('rollup-plugin-commonjs');
const json = require('@rollup/plugin-json'); const json = require('rollup-plugin-json');
const { getBabelOutputPlugin } = require('@rollup/plugin-babel'); const babel = require('rollup-plugin-babel');
const typescript = require('@rollup/plugin-typescript'); const typescript = require('rollup-plugin-typescript2');
const uglifyJs = require('./rollup-plugin-uglifyjs'); const { uglify } = require('rollup-plugin-uglify');
const eslint = require('@rollup/plugin-eslint'); const {
eslint
} = require('rollup-plugin-eslint');
const frameworkBanner = `var global=this; var process={env:{}}; ` + `var setTimeout=global.setTimeout;\n`; const frameworkBanner = `var global=this; var process={env:{}}; ` + `var setTimeout=global.setTimeout;\n`;
@ -42,15 +44,12 @@ const onwarn = warning => {
if (warning.code === 'CIRCULAR_DEPENDENCY') { if (warning.code === 'CIRCULAR_DEPENDENCY') {
return; return;
} }
if (warning.code === 'PLUGIN_WARNING') {
return;
}
console.warn(`(!) ${warning.message}`); console.warn(`(!) ${warning.message}`);
}; };
const tsPlugin = typescript({ const tsPlugin = typescript({
tsconfig: path.resolve(__dirname, 'tsconfig.json'), tsconfig: path.resolve(__dirname, 'tsconfig.json'),
module: "ESNext" check: true
}); });
const esPlugin = eslint({ const esPlugin = eslint({
@ -67,12 +66,10 @@ const configInput = {
json(), json(),
resolve(), resolve(),
commonjs(), commonjs(),
getBabelOutputPlugin({ babel({
exclude: 'node_moduels/**', exclude: 'node_moduels/**'
presets: [ '@babel/preset-env' ],
allowAllFormats: true
}), }),
uglifyJs() uglify()
] ]
}; };

View File

@ -44,7 +44,6 @@ fi
cp -f $5 $8 cp -f $5 $8
cp -f $6 $8 cp -f $6 $8
cp -f ${9} $8 cp -f ${9} $8
cp -f ${14} $8
cp -f ${12} $8 cp -f ${12} $8
cp -r $7 $8 cp -r $7 $8
if [ -d "$prebuilts_path" ]; then if [ -d "$prebuilts_path" ]; then
@ -80,7 +79,6 @@ else
fi fi
rm -rf ./runtime rm -rf ./runtime
rm -rf ./tsconfig.json rm -rf ./tsconfig.json
rm -rf rollup-plugin-uglifyjs.js
rm -rf build_strip_native_min.js rm -rf build_strip_native_min.js
rm -rf ./test rm -rf ./test
rm -rf ./.eslintrc rm -rf ./.eslintrc

13088
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,26 +18,35 @@
"mvvm" "mvvm"
], ],
"devDependencies": { "devDependencies": {
"@babel/plugin-transform-runtime": "7.23.2", "babel-core": "^6.26.3",
"@babel/core": "7.20.12", "babel-loader": "^6.4.1",
"@babel/preset-env": "7.20.2", "babel-plugin-external-helpers": "^6.22.0",
"@babel/runtime": "7.20.13", "babel-preset-env": "^1.7.0",
"babel-loader": "9.1.2", "babel-runtime": "^6.26.0",
"rollup": "3.19.1", "chai": "^4.2.0",
"@rollup/plugin-babel": "6.0.3", "mocha": "^8.2.1",
"@rollup/plugin-commonjs": "24.0.1", "rollup": "^2.32.1",
"@rollup/plugin-json": "6.0.0", "rollup-plugin-babel": "^3.0.7",
"@rollup/plugin-node-resolve": "15.0.1", "rollup-plugin-commonjs": "^10.1.0",
"@rollup/plugin-typescript": "11.0.0", "rollup-plugin-eslint": "^7.0.0",
"@rollup/plugin-eslint": "9.0.2", "rollup-plugin-json": "^4.0.0",
"typescript": "4.9.5", "rollup-plugin-node-resolve": "^5.2.0",
"tslib": "2.4.0", "rollup-plugin-tslint": "^0.2.2",
"eslint": "8.34.0", "rollup-plugin-typescript2": "^0.9.0",
"@typescript-eslint/parser": "5.51.0", "rollup-plugin-uglify": "^6.0.4",
"mocha": "10.2.0", "sinon": "^9.2.2",
"chai": "4.3.7", "ts-node": "^9.0.0",
"sinon": "15.0.4", "tslib": "^2.0.3",
"ts-node": "10.9.2", "@types/jest": "^27.4.1",
"uglify-js": "3.17.4" "@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"jest": "^27.5.1",
"prettier": "^2.6.1",
"ts-jest": "^27.1.4",
"typescript": "4.1.3"
} }
} }

View File

@ -1,17 +0,0 @@
const uglifyJS = require('uglify-js');
module.exports = function uglifyJs() {
return {
name: 'uglifyjs',
renderChunk(code) {
const res = uglifyJS.minify(code);
if (res.error) {
return;
}
return {
code: res.code,
map: { mappings: '' }
};
}
};
}