Skip to content

Commit

Permalink
perf: Switch to vite for bundling
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Feb 12, 2024
1 parent 9486b2f commit 9f47239
Show file tree
Hide file tree
Showing 10 changed files with 4,522 additions and 9,754 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Have a good time and manage whatever you want.
<database>pgsql</database>
<database>mysql</database>
<database>sqlite</database>
<nextcloud min-version="25" max-version="29"/>
<nextcloud min-version="26" max-version="29"/>
</dependencies>
<repair-steps>
<post-migration>
Expand Down
File renamed without changes.
14,239 changes: 4,502 additions & 9,737 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"url": "https://github.com/nextcloud/tables",
"type": "git"
},
"type": "module",
"url": "https://github.com/nextcloud/tables/wiki",
"license": "agpl",
"private": true,
"scripts": {
"build": "NODE_ENV=production webpack --progress --config webpack.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
"serve": "NODE_ENV=development webpack serve --progress --config webpack.js",
"build": "vite --mode production build",
"dev": "vite --mode development build",
"watch": "vite --mode development build --watch",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint 'css/*.css' 'css/*.scss' 'src/**/*.scss' 'src/**/*.vue'",
Expand Down Expand Up @@ -57,7 +57,7 @@
"@nextcloud/cypress": "^1.0.0-beta.7",
"@nextcloud/eslint-config": "^8.3.0",
"@nextcloud/stylelint-config": "^2.4.0",
"@nextcloud/webpack-vue-config": "^6.0.1",
"@nextcloud/vite-config": "^1.2.2",
"cypress": "^13.6.4",
"cypress-downloadfile": "^1.2.3"
}
Expand Down
4 changes: 0 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import store from './store/store.js'
import router from './router.js'
import VuePapaParse from 'vue-papa-parse'

__webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line
// eslint-disable-next-line
__webpack_public_path__ = generateFilePath('tables', '', 'js/')

Vue.mixin({ methods: { t, n } })
Vue.use(Vuex)
Vue.use(VuePapaParse)
Expand Down
3 changes: 0 additions & 3 deletions src/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import Vue from 'vue'

import TablesSmartPicker from './views/SmartPicker.vue'

__webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line
__webpack_public_path__ = OC.linkTo('tables', 'js/') // eslint-disable-line

registerWidget('tables_link', async (el, { richObjectType, richObject, accessible }) => {
const { default: Vue } = await import(/* webpackChunkName: "reference-table-lazy" */'vue')
const { default: TableReferenceWidget } = await import(/* webpackChunkName: "reference-table-lazy" */'./views/LinkReferenceWidget.vue')
Expand Down
6 changes: 2 additions & 4 deletions src/views/SmartPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ import IconLink from 'vue-material-design-icons/Link.vue'
import IconText from 'vue-material-design-icons/Text.vue'
import IconCheck from 'vue-material-design-icons/Check.vue'
import { generateUrl } from '@nextcloud/router'
import LinkReferenceWidget from './LinkReferenceWidget.vue'
import ContentReferenceWidget from './ContentReferenceWidget.vue'
import axios from '@nextcloud/axios'
import displayError from '../shared/utils/displayError.js'

Expand All @@ -104,8 +102,8 @@ export default {
Search,
NcCheckboxRadioSwitch,
NcButton,
LinkReferenceWidget,
ContentReferenceWidget,
LinkReferenceWidget: import('./LinkReferenceWidget.vue'),
ContentReferenceWidget: import('./ContentReferenceWidget.vue'),
NcLoadingIcon,
},

Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: Ferdinand Thiessen <opensource@fthiessen.de>
// SPDX-License-Identifier: AGPL-3.0-or-later

import { createAppConfig } from '@nextcloud/vite-config'
import path from 'path'

const config = createAppConfig({
main: path.join(__dirname, 'src', 'main.js'),
reference: path.join(__dirname, 'src', 'reference.js'),
}, {})

export default config

0 comments on commit 9f47239

Please sign in to comment.