Compare commits
No commits in common. "08ae9ebf0824194fbc830445cadc62fe61a6b2d9" and "1273ef63f0a954ccfa4d1a7caeead6d98eee1780" have entirely different histories.
08ae9ebf08
...
1273ef63f0
|
@ -1,2 +1,3 @@
|
||||||
dist
|
.snowpack
|
||||||
node_modules
|
build
|
||||||
|
node_modules
|
|
@ -14,7 +14,7 @@ function createWindow() {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
win.loadFile('./index.html');
|
win.loadFile('./index.html');
|
||||||
} else {
|
} else {
|
||||||
win.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`);
|
win.loadURL('http://localhost:8080');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the DevTools.
|
// Open the DevTools.
|
||||||
|
@ -43,7 +43,3 @@ app.on('activate', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Webpack Hot Module Replacement (HMR)
|
|
||||||
if (module.hot) {
|
|
||||||
module.hot.accept()
|
|
||||||
}
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"main": "main.js"
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,41 +1,26 @@
|
||||||
{
|
{
|
||||||
"productName": "Accord",
|
|
||||||
"name": "accord",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-webpack dev",
|
"start": "npm run build && cross-env NODE_ENV=production electron ./build",
|
||||||
"dev:nogpu": "electron-webpack dev --disable-gpu",
|
"dev": "npm run build && concurrently --kill-others --success first \"snowpack dev --open none\" \"wait-on http://localhost:8080/ && electron ./build\"",
|
||||||
"build": "electron-webpack",
|
"build": "snowpack build"
|
||||||
"dist": "npm run build && electron-builder",
|
|
||||||
"dist:dir": "npm run dist --dir -c.compression=store -c.mac.identity=null"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@snowpack/plugin-svelte": "^3.5.2",
|
||||||
|
"@snowpack/plugin-typescript": "^1.2.1",
|
||||||
"@tsconfig/svelte": "^1.0.10",
|
"@tsconfig/svelte": "^1.0.10",
|
||||||
"@types/node": "^14.14.28",
|
"@types/node": "^14.14.28",
|
||||||
|
"builtin-modules": "^3.2.0",
|
||||||
|
"concurrently": "^5.3.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"electron": "^11.2.3",
|
"electron": "^11.2.3",
|
||||||
"electron-app-settings": "^1.2.2",
|
"snowpack": "^3.0.1",
|
||||||
"electron-builder": "^22.9.1",
|
"snowpack-plugin-selective-import-to-require": "^0.3.0",
|
||||||
"electron-webpack": "^2.8.2",
|
|
||||||
"electron-webpack-ts": "^4.0.1",
|
|
||||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
|
||||||
"source-map-support": "^0.5.19",
|
|
||||||
"stylus": "^0.54.8",
|
"stylus": "^0.54.8",
|
||||||
"svelte": "^3.32.3",
|
|
||||||
"svelte-loader-hot": "^0.3.1",
|
|
||||||
"svelte-preprocess": "^4.6.9",
|
"svelte-preprocess": "^4.6.9",
|
||||||
"typescript": "^4.1.5",
|
"typescript": "^4.1.5",
|
||||||
"wait-on": "^5.2.1",
|
"wait-on": "^5.2.1"
|
||||||
"webpack": "^4.42.1"
|
|
||||||
},
|
},
|
||||||
"electronWebpack": {
|
"dependencies": {
|
||||||
"commonSourceDirectory": "src/common",
|
"svelte": "^3.32.3"
|
||||||
"staticSourceDirectory": "src/static",
|
|
||||||
"main": {
|
|
||||||
"sourceDirectory": "electron"
|
|
||||||
},
|
|
||||||
"renderer": {
|
|
||||||
"sourceDirectory": "src",
|
|
||||||
"webpackConfig": "./webpack.custom.config.js"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: sans-serif;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta name="description" content="Accord" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="./index.css" />
|
||||||
|
<title>Accord</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="module" src="./dist/index.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,38 @@
|
||||||
|
/** @type {import("snowpack").SnowpackUserConfig } */
|
||||||
|
const builtinModules = require('builtin-modules')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mount: {
|
||||||
|
/* ... */
|
||||||
|
// 'build directory'
|
||||||
|
public: '/',
|
||||||
|
electron: '/',
|
||||||
|
src: '/dist',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
/* ... */
|
||||||
|
'@snowpack/plugin-svelte',
|
||||||
|
'@snowpack/plugin-typescript',
|
||||||
|
['snowpack-plugin-selective-import-to-require', {
|
||||||
|
"modules": builtinModules,
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
routes: [
|
||||||
|
/* Enable an SPA Fallback in development: */
|
||||||
|
// {"match": "routes", "src": ".*", "dest": "/index.html"},
|
||||||
|
],
|
||||||
|
optimize: {
|
||||||
|
/* Example: Bundle your final build: */
|
||||||
|
// "bundle": true,
|
||||||
|
},
|
||||||
|
packageOptions: {
|
||||||
|
/* ... */
|
||||||
|
external: builtinModules
|
||||||
|
},
|
||||||
|
devOptions: {
|
||||||
|
/* ... */
|
||||||
|
},
|
||||||
|
buildOptions: {
|
||||||
|
/* ... */
|
||||||
|
},
|
||||||
|
};
|
|
@ -19,16 +19,6 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:global(html)
|
|
||||||
width 100%
|
|
||||||
height 100%
|
|
||||||
|
|
||||||
:global(body)
|
|
||||||
margin 0
|
|
||||||
font-family sans-serif
|
|
||||||
width 100%
|
|
||||||
height 100%
|
|
||||||
|
|
||||||
div
|
div
|
||||||
width 100%
|
width 100%
|
||||||
height 100%
|
height 100%
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import App from './App.svelte'
|
import App from './App.svelte';
|
||||||
|
|
||||||
let app = new App({
|
let app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
|
@ -6,7 +6,12 @@ let app = new App({
|
||||||
|
|
||||||
export default app
|
export default app
|
||||||
|
|
||||||
// Webpack Hot Module Replacement (HMR)
|
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.
|
||||||
if (module.hot) {
|
// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement
|
||||||
module.hot.accept()
|
if (import.meta.hot) {
|
||||||
|
import.meta.hot.accept()
|
||||||
|
import.meta.hot.dispose(() => {
|
||||||
|
app.$destroy()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
const autoPreprocess = require('svelte-preprocess')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preprocess: autoPreprocess({
|
||||||
|
defaults: {
|
||||||
|
script: 'typescript',
|
||||||
|
style: 'stylus',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
}
|
|
@ -9,14 +9,10 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"paths": {
|
"paths": {
|
||||||
},
|
},
|
||||||
|
"noEmit": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"importsNotUsedAsValues": "error",
|
"importsNotUsedAsValues": "error",
|
||||||
"target": "ES2019",
|
|
||||||
"sourceMap": true,
|
|
||||||
"types" : ["svelte", "node"],
|
|
||||||
"allowJs": true,
|
|
||||||
"moduleResolution": "node"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
const path = require("path");
|
|
||||||
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
|
|
||||||
const svelte = path.resolve('node_modules', 'svelte');
|
|
||||||
|
|
||||||
const mode = process.env.NODE_ENV || 'development'
|
|
||||||
const prod = mode === 'production'
|
|
||||||
const dev = !prod
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
svelte
|
|
||||||
},
|
|
||||||
extensions: ['.svelte', '.ts', '.js', '.mjs'],
|
|
||||||
mainFields: ['svelte', 'browser', 'module', 'main']
|
|
||||||
},
|
|
||||||
devtool: "source-map",
|
|
||||||
node: {
|
|
||||||
__dirname: false,
|
|
||||||
__filename: false
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.svelte$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: {
|
|
||||||
loader: 'svelte-loader-hot',
|
|
||||||
options: {
|
|
||||||
emitCss: false,
|
|
||||||
preprocess: require('svelte-preprocess')({
|
|
||||||
defaults: {
|
|
||||||
script: 'typescript',
|
|
||||||
style: 'stylus',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
dev,
|
|
||||||
hotReload: true,
|
|
||||||
hotOptions: {
|
|
||||||
// whether to preserve local state (i.e. any `let` variable) or
|
|
||||||
// only public props (i.e. `export let ...`)
|
|
||||||
noPreserveState: false,
|
|
||||||
// optimistic will try to recover from runtime errors happening
|
|
||||||
// during component init. This goes funky when your components are
|
|
||||||
// not pure enough.
|
|
||||||
optimistic: true,
|
|
||||||
|
|
||||||
// See docs of svelte-loader-hot for all available options:
|
|
||||||
//
|
|
||||||
// https://github.com/rixo/svelte-loader-hot#usage
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.css$/,
|
|
||||||
use: ["css-loader"],
|
|
||||||
options: {
|
|
||||||
esModule: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new FriendlyErrorsWebpackPlugin({ clearConsole: true })
|
|
||||||
],
|
|
||||||
devServer: {
|
|
||||||
contentBase: 'dist',
|
|
||||||
hot: true,
|
|
||||||
overlay: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue