Prevent packaging unneeded dependency files (#2303)

* Prevent packaging unneeded dependency files

* Exclude even more dependency files from being packaged
This commit is contained in:
absidue 2022-07-14 15:43:07 +01:00 committed by GitHub
parent 3fe2e084a4
commit 903f3a2241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 16 deletions

View File

@ -53,7 +53,27 @@ const config = {
]
}
],
files: ['_icons/iconColor.*', 'icon.svg', './dist/**/*', '!./dist/web/**/*'],
files: [
'_icons/iconColor.*',
'icon.svg',
'./dist/**/*',
'!dist/web/*',
'!**/node_modules/**/.*',
'!**/{.github,Jenkinsfile}',
'!**/{CHANGES.md,CODE_OF_CONDUCT.md,CONTRIBUTING.md,CONTRIBUTION.md,DEVELOPMENT.md,docs,docs.md,docs.mli,examples,History.md,HISTORY.md,index.html,README.md,TODO.md,UPGRADE_GUIDE.md,UPGRADING.md}',
'!**/{commitlint.config.js,.editorconfig,.eslintignore,.eslintrc.{js,yml},.gitmodules,.huskyrc,.lintstagedrc,.nvmrc,.nycrc{,.json},.prettierrc{,.yaml},tslint.json}',
'!**/{.babelrc,bower.json,Gruntfile.js,Makefile,.npmrc.proregistry,rollup.config.js,.tm_properties,.tool-versions,tsconfig.json,webpack.config.js}',
'!**/*.{{,c,m}js,min,ts}.map',
'!**/*.d.ts',
// only exclude the src directory for specific packages
// as some of them have their dist code in there and we don't want to exclude those
'!**/node_modules/{@fortawesome/vue-fontawesome,agent-base,jquery,localforage,m3u8-parser,marked,mpd-parser,performance-now,video.js,vue,vue-i18n,vue-router}/src/*',
'!**/node_modules/**/{bin,man,scripts}/*',
'!**/node_modules/jquery/dist/jquery.slim*.js',
'!**/node_modules/video.js/dist/{alt/*,video.js}',
'!**/node_modules/@videojs/*/src'
],
dmg: {
contents: [
{

View File

@ -23,7 +23,7 @@ const config = {
module: {
rules: [
{
test: /\.(j|t)s$/,
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},
@ -76,21 +76,24 @@ if (isDevMode) {
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
ignore: ['.*', 'pwabuilder-sw.js'],
dot: true,
ignore: ['**/.*', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
},
{
from: path.join(__dirname, '../_icons'),
to: path.join(__dirname, '../dist/_icons'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
{
from: path.join(__dirname, '../src/renderer/assets/img'),
to: path.join(__dirname, '../dist/images'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
]

View File

@ -37,7 +37,7 @@ const config = {
module: {
rules: [
{
test: /\.(j|t)s$/,
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},
@ -165,28 +165,32 @@ if (isDevMode) {
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
ignore: ['.*', 'pwabuilder-sw.js'],
dot: true,
ignore: ['**/.*', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
},
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/static'),
globOptions: {
ignore: ['.*', 'pwabuilder-sw.js'],
dot: true,
ignore: ['**/.*', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
},
{
from: path.join(__dirname, '../_icons'),
to: path.join(__dirname, '../dist/web/_icons'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
{
from: path.join(__dirname, '../src/renderer/assets/img'),
to: path.join(__dirname, '../dist/web/images'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
]

View File

@ -23,7 +23,7 @@ const config = {
module: {
rules: [
{
test: /\.(j|t)s$/,
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},
@ -163,21 +163,24 @@ if (isDevMode) {
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
ignore: ['.*', 'pwabuilder-sw.js'],
dot: true,
ignore: ['**/.*', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
},
{
from: path.join(__dirname, '../_icons'),
to: path.join(__dirname, '../dist/web/_icons'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
{
from: path.join(__dirname, '../src/renderer/assets/img'),
to: path.join(__dirname, '../dist/web/images'),
globOptions: {
ignore: ['.*'],
dot: true,
ignore: ['**/.*'],
},
},
]

View File

@ -26,7 +26,7 @@ const config = {
module: {
rules: [
{
test: /\.(j|t)s$/,
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},

View File

@ -25,7 +25,7 @@
"build-release": "node _scripts/build.js",
"build-release:arm64": "node _scripts/build.js arm64",
"build-release:arm32": "node _scripts/build.js arm32",
"clean": "rimraf build/ dashFiles/ dist/ storyboards/",
"clean": "rimraf build/ static/dashFiles/ dist/ static/storyboards/",
"debug": "run-s rebuild:electron debug-runner",
"debug-runner": "node _scripts/dev-runner.js --remote-debug",
"dev": "run-s rebuild:electron dev-runner",