mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 12:55:14 +03:00
feat: only use rollup output for build (#3597)
chore: reduce final package build output
This commit is contained in:
parent
046e930ffe
commit
8f85f0814b
3 changed files with 32 additions and 16 deletions
37
gulpfile.js
37
gulpfile.js
|
@ -97,9 +97,19 @@ function process_package_debug(done) {
|
||||||
getGitRevision(done, processPackage, false);
|
getGitRevision(done, processPackage, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dist_yarn MUST be done after dist_src
|
const distCommon = gulp.series(
|
||||||
|
dist_src,
|
||||||
const distCommon = gulp.series(dist_src, dist_less, dist_changelog, dist_yarn, dist_locale, dist_libraries, dist_resources, dist_rollup, gulp.series(cordova_dist()));
|
dist_node_modules_css,
|
||||||
|
dist_less,
|
||||||
|
dist_changelog,
|
||||||
|
dist_locale,
|
||||||
|
dist_libraries,
|
||||||
|
dist_resources,
|
||||||
|
dist_rollup,
|
||||||
|
gulp.series(
|
||||||
|
cordova_dist(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const distBuild = gulp.series(process_package_release, distCommon);
|
const distBuild = gulp.series(process_package_release, distCommon);
|
||||||
|
|
||||||
|
@ -344,9 +354,12 @@ function processPackage(done, gitRevision, isReleaseBuild) {
|
||||||
function dist_src() {
|
function dist_src() {
|
||||||
const distSources = [
|
const distSources = [
|
||||||
'./src/**/*',
|
'./src/**/*',
|
||||||
|
'!./src/**/*.js',
|
||||||
|
'!./src/**/*.vue',
|
||||||
'!./src/css/dropdown-lists/LICENSE',
|
'!./src/css/dropdown-lists/LICENSE',
|
||||||
'!./src/support/**',
|
'!./src/support/**',
|
||||||
'!./src/**/*.less',
|
'!./src/**/*.less',
|
||||||
|
'./src/js/workers/hex_parser.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
return gulp.src(distSources, { base: 'src' })
|
return gulp.src(distSources, { base: 'src' })
|
||||||
|
@ -354,12 +367,17 @@ function dist_src() {
|
||||||
.pipe(gulp.dest(DIST_DIR));
|
.pipe(gulp.dest(DIST_DIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dist_node_modules_css() {
|
||||||
|
return gulp.src('./**/*.min.css')
|
||||||
|
.pipe(gulp.dest(DIST_DIR));
|
||||||
|
}
|
||||||
|
|
||||||
function dist_less() {
|
function dist_less() {
|
||||||
return gulp.src('./src/**/*.less')
|
return gulp.src('./src/**/*.less')
|
||||||
.pipe(sourcemaps.init())
|
.pipe(sourcemaps.init())
|
||||||
.pipe(less())
|
.pipe(less())
|
||||||
.pipe(sourcemaps.write('.'))
|
.pipe(sourcemaps.write('.'))
|
||||||
.pipe(gulp.dest(`${DIST_DIR}`));
|
.pipe(gulp.dest(DIST_DIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
function dist_changelog() {
|
function dist_changelog() {
|
||||||
|
@ -367,15 +385,6 @@ function dist_changelog() {
|
||||||
.pipe(gulp.dest(`${DIST_DIR}tabs/`));
|
.pipe(gulp.dest(`${DIST_DIR}tabs/`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function relies on files from the dist_src function
|
|
||||||
function dist_yarn() {
|
|
||||||
return gulp.src([`${DIST_DIR}package.json`, `${DIST_DIR}yarn.lock`])
|
|
||||||
.pipe(gulp.dest(DIST_DIR))
|
|
||||||
.pipe(yarn({
|
|
||||||
production: true,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
function dist_locale() {
|
function dist_locale() {
|
||||||
return gulp.src('./locales/**/*', { base: 'locales'})
|
return gulp.src('./locales/**/*', { base: 'locales'})
|
||||||
.pipe(gulp.dest(`${DIST_DIR}locales`));
|
.pipe(gulp.dest(`${DIST_DIR}locales`));
|
||||||
|
@ -400,6 +409,7 @@ function dist_rollup() {
|
||||||
|
|
||||||
return rollup
|
return rollup
|
||||||
.rollup({
|
.rollup({
|
||||||
|
strictDeprecations: true,
|
||||||
input: {
|
input: {
|
||||||
// For any new file migrated to modules add the output path
|
// For any new file migrated to modules add the output path
|
||||||
// in dist on the left, on the right it's input file path.
|
// in dist on the left, on the right it's input file path.
|
||||||
|
@ -441,7 +451,6 @@ function dist_rollup() {
|
||||||
// we want to see code in the same way as it
|
// we want to see code in the same way as it
|
||||||
// is in the source files while debugging
|
// is in the source files while debugging
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
// put any 3rd party module in vendor.js
|
|
||||||
manualChunks(id) {
|
manualChunks(id) {
|
||||||
/**
|
/**
|
||||||
* This splits every npm module loaded in into it's own package
|
* This splits every npm module loaded in into it's own package
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
"nw-builder": "3.8.3",
|
"nw-builder": "3.8.3",
|
||||||
"os": "^0.1.2",
|
"os": "^0.1.2",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
"rollup": "^3.9.0",
|
"rollup": "^3.29.4",
|
||||||
"rollup-plugin-copy": "^3.5.0",
|
"rollup-plugin-copy": "^3.5.0",
|
||||||
"rollup-plugin-vue": "^5.*.*",
|
"rollup-plugin-vue": "^5.*.*",
|
||||||
"rpm-builder": "^1.2.1",
|
"rpm-builder": "^1.2.1",
|
||||||
|
|
|
@ -13263,13 +13263,20 @@ rollup-pluginutils@^2.8.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
estree-walker "^0.6.1"
|
estree-walker "^0.6.1"
|
||||||
|
|
||||||
rollup@^3.27.1, rollup@^3.9.0:
|
rollup@^3.27.1:
|
||||||
version "3.29.0"
|
version "3.29.0"
|
||||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.0.tgz#1b40e64818afc979c7e5bef93de675829288986b"
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.0.tgz#1b40e64818afc979c7e5bef93de675829288986b"
|
||||||
integrity sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w==
|
integrity sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.2"
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
|
rollup@^3.29.4:
|
||||||
|
version "3.29.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981"
|
||||||
|
integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==
|
||||||
|
optionalDependencies:
|
||||||
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
rpm-builder@^1.2.1:
|
rpm-builder@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/rpm-builder/-/rpm-builder-1.2.1.tgz#94655088266ec213f474efec0a9d9034404d0331"
|
resolved "https://registry.yarnpkg.com/rpm-builder/-/rpm-builder-1.2.1.tgz#94655088266ec213f474efec0a9d9034404d0331"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue