Don't use webpack to transpile ts into js for frontend

This commit is contained in:
Alice Gaudon 2020-05-26 09:37:44 +02:00
parent 56b876c63a
commit b7f5ca9da6
5 changed files with 14 additions and 12 deletions

View File

@ -1,9 +1,8 @@
{
"bundles": {
"index": "ts/index.ts",
"settings": "ts/settings.ts",
"service-settings": "ts/service-settings.ts",
"files": "ts/files.ts",
"layout": "sass/layout.scss",
"files": "ts/files.ts"
"index": "sass/index.scss",
"service-settings": "sass/service-settings.scss"
}
}

View File

@ -7,7 +7,6 @@ import {
UpdateTargetUrlEvent,
WebContents
} from "electron";
import "../sass/index.scss";
const {
Menu,

View File

@ -1,5 +1,4 @@
import {ipcRenderer, remote} from "electron";
import "../sass/service-settings.scss";
let isImageCheckbox: HTMLInputElement | null;
let builtInIconSearchField: HTMLInputElement | null;

View File

@ -11,10 +11,10 @@
"main": "build/main.js",
"scripts": {
"clean": "(! test -d build || rm -r build) && (! test -d resources || rm -r resources)",
"compile": "yarn clean && tsc -p tsconfig.backend.json && webpack --mode production",
"compile-dev": "yarn clean && tsc -p tsconfig.backend.json && webpack --mode development",
"compile": "yarn clean && tsc -p tsconfig.backend.json && tsc -p tsconfig.frontend.json && webpack --mode production",
"compile-dev": "yarn clean && tsc -p tsconfig.backend.json && tsc -p tsconfig.frontend.json && webpack --mode development",
"start": "yarn compile && electron .",
"dev": "yarn compile-dev && concurrently -k -n \"Electron,Webpack\" -p \"[{name}]\" -c \"green,yellow\" \"electron . --dev\" \"webpack --mode development --watch\"",
"dev": "yarn compile-dev && concurrently -k -n \"Electron,Webpack,TSC-Frontend\" -p \"[{name}]\" -c \"green,yellow\" \"electron . --dev\" \"webpack --mode development --watch\" \"tsc -p tsconfig.frontend.json --watch\"",
"build": "yarn compile && electron-builder -wl",
"release": "yarn compile && GH_TOKEN=$(cat GH_TOKEN) electron-builder -wlp always"
},

View File

@ -14,7 +14,7 @@ for (const b in userConfig.bundles) {
const config = {
entry: userConfig.bundles,
output: {
path: path.resolve(__dirname, 'resources/js'),
path: path.resolve(__dirname, 'resources/useless-js'), // Temporary until webpack stops emitting js for css files
filename: '[name].js'
},
devtool: dev ? 'eval-source-map' : undefined,
@ -69,8 +69,13 @@ const config = {
},
{
test: /\.ts$/i,
use: 'ts-loader',
exclude: '/node_modules/',
use: {
loader: 'ts-loader',
options: {
configFile: 'tsconfig.frontend.json',
}
},
exclude: '/node_modules/'
},
{
test: /\.html$/i,