Add tauri:dev command

This commit is contained in:
Martin Kleinschrodt 2021-06-28 18:08:34 +02:00
parent 6ebce86871
commit 238b53ad97
4 changed files with 24 additions and 22 deletions

View File

@ -26,9 +26,10 @@
"pwa:start": "lerna run start --scope @padloc/pwa",
"server:start": "lerna run start --scope @padloc/server",
"start": "npm run pwa:build && lerna run --scope '@padloc/{server,pwa}' --parallel start",
"dev": "lerna run --parallel dev",
"dev": "lerna run --parallel --scope '@padloc/{server,pwa}' --parallel dev",
"tauri:dev": "lerna run --parallel --scope '@padloc/{server,tauri}' --parallel dev",
"repl": "cd packages/server && npm run repl && cd ../..",
"test": "lerna run test",
"locale:extract": "lerna run extract --scope '@padloc/locale'"
}
}
}

View File

@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"tauri": "tauri",
"build": "webpack && tauri build"
"build": "tauri build",
"dev": "tauri dev"
},
"author": "",
"license": "ISC",
@ -27,4 +28,4 @@
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
}
}
}

View File

@ -6,8 +6,8 @@
"build": {
"distDir": "../dist",
"devPath": "http://localhost:8080",
"beforeDevCommand": "",
"beforeBuildCommand": ""
"beforeDevCommand": "webpack serve",
"beforeBuildCommand": "webpack"
},
"tauri": {
"bundle": {
@ -52,8 +52,8 @@
"windows": [
{
"title": "Padloc",
"width": 800,
"height": 600,
"width": 1024,
"height": 768,
"resizable": true,
"fullscreen": false
}
@ -62,4 +62,4 @@
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}
}
}
}

View File

@ -13,50 +13,50 @@ module.exports = {
path: out,
filename: "[name].js",
chunkFilename: "[name].chunk.js",
publicPath: "/"
publicPath: "/",
},
mode: "development",
devtool: "source-map",
stats: "minimal",
resolve: {
extensions: [".ts", ".js"]
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader"
loader: "ts-loader",
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
use: ["style-loader", "css-loader"],
},
{
test: /\.(woff|woff2|eot|ttf|otf|svg)$/,
use: ["file-loader"]
}
]
use: ["file-loader"],
},
],
},
plugins: [
new EnvironmentPlugin({
PL_SERVER_URL: serverUrl,
PL_BILLING_ENABLED: null,
PL_BILLING_DISABLE_PAYMENT: null,
PL_BILLING_DISABLE_PAYMENT: true,
PL_BILLING_STRIPE_PUBLIC_KEY: null,
PL_SUPPORT_EMAIL: "support@padloc.app",
PL_VERSION: version,
PL_DISABLE_SW: true
PL_DISABLE_SW: true,
}),
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: "Padloc",
template: path.resolve(__dirname, "src/index.html")
})
template: path.resolve(__dirname, "src/index.html"),
}),
],
devServer: {
contentBase: path.resolve(__dirname, "dist"),
historyApiFallback: true,
host: "0.0.0.0",
port: process.env.PL_PWA_PORT || 8080
}
port: process.env.PL_PWA_PORT || 8080,
},
};