зеркало из https://github.com/nextcloud/photos.git
fix: do not run unwanted plugins in dev mode
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
Родитель
5d0c00ada5
Коммит
abd6e8f52e
|
@ -20,10 +20,6 @@ const mutations = {
|
|||
* @param {Array} data.files list of files
|
||||
*/
|
||||
updateFolders(state, { fileid, files }) {
|
||||
if (!state.folders[fileid]) {
|
||||
Vue.set(state.folders, fileid, [])
|
||||
}
|
||||
|
||||
if (files.length > 0) {
|
||||
// sort by last modified
|
||||
const list = files
|
||||
|
@ -73,7 +69,6 @@ const mutations = {
|
|||
|
||||
const getters = {
|
||||
folders: state => state.folders,
|
||||
paths: state => state.paths,
|
||||
folder: state => fileid => state.folders[fileid],
|
||||
folderId: state => path => state.paths[path],
|
||||
}
|
||||
|
|
44
webpack.js
44
webpack.js
|
@ -11,6 +11,8 @@ const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-m
|
|||
const WorkboxPlugin = require('workbox-webpack-plugin')
|
||||
const { basename } = require('path')
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
webpackConfig.entry = {
|
||||
main: path.join(__dirname, 'src', 'main.js'),
|
||||
public: path.join(__dirname, 'src', 'public.js'),
|
||||
|
@ -89,27 +91,29 @@ webpackConfig.plugins.push(
|
|||
})
|
||||
)
|
||||
|
||||
// block creation of LICENSE.txt files now replaced with .license files
|
||||
webpackConfig.optimization.minimizer = [new TerserPlugin({
|
||||
extractComments: false,
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: false,
|
||||
if (!isDev) {
|
||||
// block creation of LICENSE.txt files now replaced with .license files
|
||||
webpackConfig.optimization.minimizer = [new TerserPlugin({
|
||||
extractComments: false,
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})]
|
||||
})]
|
||||
|
||||
webpackConfig.plugins = [
|
||||
...webpackConfig.plugins,
|
||||
// Generate reuse license files
|
||||
new WebpackSPDXPlugin({
|
||||
override: {
|
||||
// TODO: Remove if they fixed the license in the package.json
|
||||
'@nextcloud/axios': 'GPL-3.0-or-later',
|
||||
'@nextcloud/vue': 'AGPL-3.0-or-later',
|
||||
'nextcloud-vue-collections': 'AGPL-3.0-or-later',
|
||||
}
|
||||
}),
|
||||
]
|
||||
webpackConfig.plugins = [
|
||||
...webpackConfig.plugins,
|
||||
// Generate reuse license files
|
||||
new WebpackSPDXPlugin({
|
||||
override: {
|
||||
// TODO: Remove if they fixed the license in the package.json
|
||||
'@nextcloud/axios': 'GPL-3.0-or-later',
|
||||
'@nextcloud/vue': 'AGPL-3.0-or-later',
|
||||
'nextcloud-vue-collections': 'AGPL-3.0-or-later',
|
||||
}
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
|
|
Загрузка…
Ссылка в новой задаче