diff options
author | Richard Steinmetz <steinmetz.richard@googlemail.com> | 2020-12-23 20:37:35 +0300 |
---|---|---|
committer | Richard Steinmetz <steinmetz.richard@googlemail.com> | 2020-12-23 20:59:19 +0300 |
commit | ac1a2c3b15ec69e1750fc07c5b23e1e9171d3f6a (patch) | |
tree | d8b3700aae2f322dfcc3e04bb733a7fb9b9b8f9d /package.json | |
parent | 332d45fa530ae716ae130db8fb88fb45bb2127b3 (diff) |
Update frontend code
Introduce webpack to bundle required dependencies instead of relying on global libraries. Those global libraries are deprecated and will be removed soon.
I tried to change the existing code as little as possible. However, the diff is huge because I fixed the indentation (tabs and spaces were mixed). Additionally, I tried to keep package.json and webpack.common.js as minimal as possible and took some inspiration from other official nextcloud apps.
Npm scripts:
- Production build: `npm run build`
- Development build: `npm run dev`
- Build and watch for changes: `npm run watch`
The build script should be run before pushing a release. The source files (inside src/), installed packages (inside node_modules/) and various js configs (webpack.*.js, package*.json and babel.config.json) can be omitted from a release. Webpack will output the generated code to js/.
Signed-off-by: Richard Steinmetz <steinmetz.richard@googlemail.com>
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/package.json b/package.json new file mode 100644 index 0000000..9c9444c --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "checksum", + "description": "Checksum app for Nextcloud", + "version": "1.1.0", + "author": "westberliner", + "license": "agpl", + "private": true, + "scripts": { + "build": "NODE_ENV=production webpack --config webpack.prod.js", + "dev": "NODE_ENV=development webpack --config webpack.dev.js", + "watch": "NODE_ENV=development webpack --config webpack.dev.js --watch" + }, + "dependencies": { + "@nextcloud/axios": "^1.5.0", + "@nextcloud/router": "^1.2.0", + "core-js": "^3.8.1" + }, + "devDependencies": { + "@babel/core": "^7.12.10", + "@babel/preset-env": "^7.12.11", + "@nextcloud/browserslist-config": "^1.0.0", + "babel-loader": "^8.2.2", + "webpack": "^5.11.0", + "webpack-cli": "^4.2.0", + "webpack-merge": "^5.7.2" + }, + "browserslist": [ + "extends @nextcloud/browserslist-config" + ] +} |