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": { "bundles": {
"index": "ts/index.ts", "files": "ts/files.ts",
"settings": "ts/settings.ts",
"service-settings": "ts/service-settings.ts",
"layout": "sass/layout.scss", "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, UpdateTargetUrlEvent,
WebContents WebContents
} from "electron"; } from "electron";
import "../sass/index.scss";
const { const {
Menu, Menu,

View File

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

View File

@ -11,10 +11,10 @@
"main": "build/main.js", "main": "build/main.js",
"scripts": { "scripts": {
"clean": "(! test -d build || rm -r build) && (! test -d resources || rm -r resources)", "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": "yarn clean && tsc -p tsconfig.backend.json && tsc -p tsconfig.frontend.json && webpack --mode production",
"compile-dev": "yarn clean && tsc -p tsconfig.backend.json && webpack --mode development", "compile-dev": "yarn clean && tsc -p tsconfig.backend.json && tsc -p tsconfig.frontend.json && webpack --mode development",
"start": "yarn compile && electron .", "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", "build": "yarn compile && electron-builder -wl",
"release": "yarn compile && GH_TOKEN=$(cat GH_TOKEN) electron-builder -wlp always" "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 = { const config = {
entry: userConfig.bundles, entry: userConfig.bundles,
output: { 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' filename: '[name].js'
}, },
devtool: dev ? 'eval-source-map' : undefined, devtool: dev ? 'eval-source-map' : undefined,
@ -69,8 +69,13 @@ const config = {
}, },
{ {
test: /\.ts$/i, test: /\.ts$/i,
use: 'ts-loader', use: {
exclude: '/node_modules/', loader: 'ts-loader',
options: {
configFile: 'tsconfig.frontend.json',
}
},
exclude: '/node_modules/'
}, },
{ {
test: /\.html$/i, test: /\.html$/i,