Compare commits
3 Commits
stable25
...
backport/4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cf40ae9af | ||
|
|
083db2f3b6 | ||
|
|
cfd0fc828f |
@@ -20,6 +20,7 @@
|
|||||||
"build": "NODE_ENV=production webpack --progress --config webpack.js",
|
"build": "NODE_ENV=production webpack --progress --config webpack.js",
|
||||||
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
|
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
|
||||||
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
|
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
|
||||||
|
"serve": "webpack serve --node-env development --allowed-hosts all --config webpack.js",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||||
"stylelint": "stylelint src",
|
"stylelint": "stylelint src",
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
import { subscribe } from '@nextcloud/event-bus'
|
import { subscribe } from '@nextcloud/event-bus'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
|
|
||||||
|
import './shared-init.js'
|
||||||
|
|
||||||
subscribe('calendar:handle-todo-click', ({ calendarId, taskId }) => {
|
subscribe('calendar:handle-todo-click', ({ calendarId, taskId }) => {
|
||||||
const deckAppPrefix = 'app-generated--deck--board-'
|
const deckAppPrefix = 'app-generated--deck--board-'
|
||||||
if (calendarId.startsWith(deckAppPrefix)) {
|
if (calendarId.startsWith(deckAppPrefix)) {
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import CardReferenceWidget from './views/CardReferenceWidget.vue'
|
|||||||
|
|
||||||
import { translate, translatePlural } from '@nextcloud/l10n'
|
import { translate, translatePlural } from '@nextcloud/l10n'
|
||||||
|
|
||||||
|
import './shared-init.js'
|
||||||
|
|
||||||
Vue.prototype.t = translate
|
Vue.prototype.t = translate
|
||||||
Vue.prototype.n = translatePlural
|
Vue.prototype.n = translatePlural
|
||||||
Vue.prototype.OC = window.OC
|
Vue.prototype.OC = window.OC
|
||||||
|
|||||||
@@ -26,10 +26,7 @@ import './../css/collections.css'
|
|||||||
import FileSharingPicker from './views/FileSharingPicker.js'
|
import FileSharingPicker from './views/FileSharingPicker.js'
|
||||||
import { buildSelector } from './helpers/selector.js'
|
import { buildSelector } from './helpers/selector.js'
|
||||||
|
|
||||||
// eslint-disable-next-line
|
import './shared-init.js'
|
||||||
__webpack_nonce__ = btoa(OC.requestToken);
|
|
||||||
// eslint-disable-next-line
|
|
||||||
__webpack_public_path__ = OC.linkTo('deck', 'js/');
|
|
||||||
|
|
||||||
Vue.prototype.t = t
|
Vue.prototype.t = t
|
||||||
Vue.prototype.n = n
|
Vue.prototype.n = n
|
||||||
|
|||||||
@@ -27,10 +27,7 @@ import CardCreateDialog from './CardCreateDialog.vue'
|
|||||||
import { buildSelector } from './helpers/selector.js'
|
import { buildSelector } from './helpers/selector.js'
|
||||||
import './init-collections.js'
|
import './init-collections.js'
|
||||||
|
|
||||||
// eslint-disable-next-line
|
import './shared-init.js'
|
||||||
__webpack_nonce__ = btoa(OC.requestToken);
|
|
||||||
// eslint-disable-next-line
|
|
||||||
__webpack_public_path__ = OC.linkTo('deck', 'js/');
|
|
||||||
|
|
||||||
Vue.prototype.t = t
|
Vue.prototype.t = t
|
||||||
Vue.prototype.n = n
|
Vue.prototype.n = n
|
||||||
|
|||||||
@@ -25,22 +25,16 @@ import router from './router.js'
|
|||||||
import store from './store/main.js'
|
import store from './store/main.js'
|
||||||
import { sync } from 'vuex-router-sync'
|
import { sync } from 'vuex-router-sync'
|
||||||
import { translate, translatePlural } from '@nextcloud/l10n'
|
import { translate, translatePlural } from '@nextcloud/l10n'
|
||||||
import { generateFilePath } from '@nextcloud/router'
|
|
||||||
import { showError } from '@nextcloud/dialogs'
|
import { showError } from '@nextcloud/dialogs'
|
||||||
import { subscribe } from '@nextcloud/event-bus'
|
import { subscribe } from '@nextcloud/event-bus'
|
||||||
import { Tooltip } from '@nextcloud/vue'
|
import { Tooltip } from '@nextcloud/vue'
|
||||||
import ClickOutside from 'vue-click-outside'
|
import ClickOutside from 'vue-click-outside'
|
||||||
|
import './shared-init.js'
|
||||||
import './models/index.js'
|
import './models/index.js'
|
||||||
|
|
||||||
// the server snap.js conflicts with vertical scrolling so we disable it
|
// the server snap.js conflicts with vertical scrolling so we disable it
|
||||||
document.body.setAttribute('data-snap-ignore', 'true')
|
document.body.setAttribute('data-snap-ignore', 'true')
|
||||||
|
|
||||||
// eslint-disable-next-line
|
|
||||||
__webpack_nonce__ = btoa(OC.requestToken)
|
|
||||||
if (!process.env.HOT) {
|
|
||||||
// eslint-disable-next-line
|
|
||||||
__webpack_public_path__ = generateFilePath('deck', '', 'js/')
|
|
||||||
}
|
|
||||||
sync(store, router)
|
sync(store, router)
|
||||||
|
|
||||||
Vue.prototype.t = translate
|
Vue.prototype.t = translate
|
||||||
|
|||||||
12
src/shared-init.js
Normal file
12
src/shared-init.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { generateFilePath } from '@nextcloud/router'
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
__webpack_nonce__ = btoa(OC.requestToken)
|
||||||
|
|
||||||
|
if (!process.env.WEBPACK_SERVE) {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
__webpack_public_path__ = generateFilePath('deck', '', 'js/')
|
||||||
|
} else {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
__webpack_public_path__ = 'http://127.0.0.1:3000/'
|
||||||
|
}
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
const webpack = require('webpack');
|
|
||||||
const merge = require('webpack-merge');
|
|
||||||
const dev = require('./webpack.dev.js');
|
|
||||||
|
|
||||||
module.exports = merge(dev, {
|
|
||||||
devServer: {
|
|
||||||
hot: true,
|
|
||||||
port: 3000,
|
|
||||||
/**
|
|
||||||
* This makes sure the main entrypoint is written to disk so it is
|
|
||||||
* loaded by Nextcloud though our existing addScript calls
|
|
||||||
*/
|
|
||||||
writeToDisk: (filePath) => {
|
|
||||||
return /deck\.js$/.test(filePath);
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
||||||
'process.env.HOT': true
|
|
||||||
})
|
|
||||||
]
|
|
||||||
})
|
|
||||||
12
webpack.js
12
webpack.js
@@ -1,10 +1,11 @@
|
|||||||
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
||||||
|
const webpack = require('webpack')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||||
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
||||||
|
|
||||||
const buildMode = process.env.NODE_ENV
|
const buildMode = process.env.NODE_ENV
|
||||||
const isDev = buildMode === 'development'
|
const isDevServer = process.env.WEBPACK_SERVE
|
||||||
|
|
||||||
webpackConfig.entry = {
|
webpackConfig.entry = {
|
||||||
...webpackConfig.entry,
|
...webpackConfig.entry,
|
||||||
@@ -15,6 +16,14 @@ webpackConfig.entry = {
|
|||||||
'card-reference': path.join(__dirname, 'src', 'init-card-reference.js'),
|
'card-reference': path.join(__dirname, 'src', 'init-card-reference.js'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isDevServer) {
|
||||||
|
webpackConfig.output.publicPath = 'http://127.0.0.1:3000/'
|
||||||
|
webpackConfig.plugins.push(
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env.WEBPACK_SERVE': true,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
} else {
|
||||||
webpackConfig.stats = {
|
webpackConfig.stats = {
|
||||||
context: path.resolve(__dirname, 'src'),
|
context: path.resolve(__dirname, 'src'),
|
||||||
assets: true,
|
assets: true,
|
||||||
@@ -22,6 +31,7 @@ webpackConfig.stats = {
|
|||||||
chunks: true,
|
chunks: true,
|
||||||
modules: true,
|
modules: true,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
webpackConfig.plugins.push(
|
webpackConfig.plugins.push(
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
|||||||
Reference in New Issue
Block a user