fix build: remove ts, replace hash with chunkhash on webpack conf

This commit is contained in:
Simon Vieille
2024-10-27 18:06:10 +01:00
parent 894e4408f9
commit 6ea1a4e6c6
4 changed files with 16 additions and 20 deletions
+6 -6
View File
@@ -7,16 +7,16 @@ when:
branch: [master, develop, feature/*, fix/*, bugfix/*, translations] branch: [master, develop, feature/*, fix/*, bugfix/*, translations]
steps: steps:
# "Install dependencies": "Install dependencies":
# image: node:20 image: node:20
# pull: true pull: true
# commands: commands:
# - npm i - npm i
"Build JS": "Build JS":
image: node:20 image: node:20
commands: commands:
- make build - npm run build
"Build translations": "Build translations":
image: deblan/php:8.3 image: deblan/php:8.3
+1
View File
@@ -16,6 +16,7 @@
"@nextcloud/event-bus": "^3.3.1", "@nextcloud/event-bus": "^3.3.1",
"@nextcloud/initial-state": "^2.2.0", "@nextcloud/initial-state": "^2.2.0",
"@nextcloud/l10n": "^3.1.0", "@nextcloud/l10n": "^3.1.0",
"@nextcloud/vue": "^8.19.0",
"@vueuse/core": "^11.1.0", "@vueuse/core": "^11.1.0",
"axios": "^1.6.7", "axios": "^1.6.7",
"trim": "^1.0.1" "trim": "^1.0.1"
+7 -12
View File
@@ -70,9 +70,7 @@
</nav> </nav>
</template> </template>
<script lang="ts"> <script>
import type { INavigationEntry } from '../types/navigation'
import { subscribe, unsubscribe } from '@nextcloud/event-bus' import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state' import { loadState } from '@nextcloud/initial-state'
import { n, t } from '@nextcloud/l10n' import { n, t } from '@nextcloud/l10n'
@@ -80,7 +78,6 @@ import { useElementSize } from '@vueuse/core'
import { defineComponent, ref } from 'vue' import { defineComponent, ref } from 'vue'
import axios from '@nextcloud/axios' import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router' import { generateOcsUrl } from '@nextcloud/router'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js' import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js'
@@ -88,7 +85,8 @@ export default defineComponent({
name: 'AppMenu', name: 'AppMenu',
components: { components: {
NcActions, NcActionLink, NcActions,
NcActionLink,
}, },
setup() { setup() {
@@ -111,7 +109,8 @@ export default defineComponent({
mounted() { mounted() {
axios.get(generateOcsUrl('core/navigation', 2) + '/apps?format=json') axios.get(generateOcsUrl('core/navigation', 2) + '/apps?format=json')
.then(({ data }) => { .then((response) => response.data)
.then((data) => {
if (data.ocs.meta.statuscode !== 200) { if (data.ocs.meta.statuscode !== 200) {
return return
} }
@@ -128,10 +127,6 @@ export default defineComponent({
}) })
}, },
beforeDestroy() {
unsubscribe('nextcloud:app-menu.refresh', this.setApps)
},
methods: { methods: {
update() { update() {
++this.state ++this.state
@@ -156,7 +151,7 @@ export default defineComponent({
return maxApps return maxApps
}, },
setNavigationCounter(id: string, counter: number) { setNavigationCounter(id, counter) {
const app = this.appList.find(({ app }) => app === id) const app = this.appList.find(({ app }) => app === id)
if (app) { if (app) {
this.$set(app, 'unread', counter) this.$set(app, 'unread', counter)
@@ -187,7 +182,7 @@ export default defineComponent({
return app.name return app.name
+ (app.active ? ' (' + t('core', 'Currently open') + ')' : '') + (app.active ? ' (' + t('core', 'Currently open') + ')' : '')
+ (app.unread > 0 ? ' (' + n('core', '{count} notification', '{count} notifications', app.unread, { count: app.unread }) + ')' : '') + (app.unread > 0 ? ' (' + n('core', '{count} notification', '{count} notifications', app.unread, { count: app.unread }) + ')' : '')
} },
makeStyle(app) { makeStyle(app) {
if (app.order !== null) { if (app.order !== null) {
+2 -2
View File
@@ -14,8 +14,8 @@ module.exports = {
output: { output: {
path: path.resolve(__dirname, './js'), path: path.resolve(__dirname, './js'),
publicPath: '/js', publicPath: '/js',
filename: '[name].js?v=[hash]', filename: '[name].js?v=[chunkhash]',
chunkFilename: 'chunks/[name]-[hash].js', chunkFilename: 'chunks/[name]-[chunkhash].js',
}, },
module: { module: {
rules: [{ rules: [{