Update webpack and babel config

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2021-07-24 14:30:47 +02:00
parent 18722b5b87
commit 30fa51b459
4 changed files with 3443 additions and 1340 deletions

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
const babelConfig = require('@nextcloud/babel-config')
module.exports = babelConfig

4725
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,10 @@
"version": "4.3.0",
"main": "js/index.js",
"scripts": {
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
"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",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint src",
@ -34,8 +35,6 @@
"humanize-duration": "^3.25.2",
"sanitize-html": "^2.3.2",
"lodash": "^4.17.21",
"style-loader": "^1.3.0",
"url-loader": "^4.1.1",
"vue": "^2.6.12",
"vue-click-outside": "^1.1.0",
"vue-material-design-icons": "^4.11.0",
@ -46,18 +45,19 @@
},
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@babel/core": "^7.13.16",
"@babel/core": "^7.13.10",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/preset-env": "^7.13.15",
"@nextcloud/babel-config": "^1.0.0",
"@nextcloud/browserslist-config": "^2.1.0",
"@nextcloud/eslint-config": "^2.2.0",
"@nextcloud/eslint-plugin": "^1.5.0",
"@nextcloud/webpack-vue-config": "^1.4.1",
"@nextcloud/webpack-vue-config": "^4",
"@vue/test-utils": "^1.1.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"css-loader": "^5.2.4",
"eslint": "^6.8.0",
"css-loader": "^4.3.0",
"eslint": "^7.22.0",
"eslint-config-standard": "^14.1.1",
"eslint-import-resolver-webpack": "^0.13.0",
"eslint-loader": "^4.0.2",
@ -66,18 +66,23 @@
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-vue": "^6.2.2",
"eslint-webpack-plugin": "^2.5.2",
"file-loader": "^6.2.0",
"node-polyfill-webpack-plugin": "^1.1.0",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"sass": "^1.32.8",
"sass-loader": "^10.0.5",
"style-loader": "^2.0.0",
"stylelint": "^13.12.0",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-scss": "^3.19.0",
"stylelint-webpack-plugin": "^2.1.1",
"url-loader": "^4.1.1",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^5.7.3"
"webpack": "^5.4.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2"
},
"engines": {
"node": ">=10.0.0"

View File

@ -1,27 +1,9 @@
const { merge } = require('webpack-merge')
const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const config = {
entry: {
admin: path.join(__dirname, 'src', 'admin.js'),
'service-worker': path.join(__dirname, 'src', 'service-worker.js'),
flow: path.join(__dirname, 'src', 'flow.js'),
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
],
},
}
module.exports = webpackConfig
const mergedConfigs = merge(config, webpackConfig)
// Remove duplicate rules by the `test` key
mergedConfigs.module.rules = mergedConfigs.module.rules.filter((v, i, a) => a.findIndex(t => (t.test.toString() === v.test.toString())) === i)
module.exports = mergedConfigs
webpackConfig.entry.admin = path.join(__dirname, 'src', 'admin.js')
webpackConfig.entry['service-worker'] = path.join(__dirname, 'src', 'service-worker.js')
webpackConfig.entry.flow = path.join(__dirname, 'src', 'flow.js')
webpackConfig.entry.dashboard = path.join(__dirname, 'src', 'dashboard.js')