diff --git a/package.json b/package.json index 62d1f8a8..af6427b4 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ "license": "agpl", "private": true, "scripts": { - "build": "webpack --node-env production --progress --config webpack.js", - "dev": "webpack --node-env development --progress --config webpack.js", - "watch": "webpack --node-env development --progress --watch --config webpack.js", - "serve": "webpack serve --node-env development --progress --config webpack.js", + "build": "webpack --node-env production --progress", + "dev": "webpack --node-env development --progress", + "watch": "webpack --node-env development --progress --watch", + "serve": "webpack serve --node-env development --progress", "e2e": "playwright test" }, "dependencies": { diff --git a/tsconfig.json b/tsconfig.json index ba85af84..ea8055d2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ "moduleResolution": "node", "sourceMap": true, "allowSyntheticDefaultImports": true, - "jsx": "preserve", "useDefineForClassFields": true, "noImplicitThis": true, "noImplicitAny": true, @@ -18,5 +17,10 @@ }, "vueCompilerOptions": { "target": 2.7 - } + }, + "ts-node": { + "compilerOptions": { + "module": "CommonJS", + } + }, } \ No newline at end of file diff --git a/webpack.js b/webpack.config.ts similarity index 88% rename from webpack.js rename to webpack.config.ts index c8bfa5d5..0462c561 100644 --- a/webpack.js +++ b/webpack.config.ts @@ -1,13 +1,13 @@ -const webpack = require('webpack'); -const path = require('path'); +import webpack from 'webpack'; +import path from 'path'; -const WorkboxPlugin = require('workbox-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); -const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); -const { VueLoaderPlugin } = require('vue-loader'); +import WorkboxPlugin from 'workbox-webpack-plugin'; +import TerserPlugin from 'terser-webpack-plugin'; +import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; +import { VueLoaderPlugin } from 'vue-loader'; -const appName = process.env.npm_package_name; -const appVersion = process.env.npm_package_version; +const appName = process.env.npm_package_name!; +const appVersion = process.env.npm_package_version!; const buildMode = process.env.NODE_ENV; const isDev = buildMode === 'development'; console.info('Building', appName, appVersion, '\n'); @@ -38,7 +38,7 @@ module.exports = { // Make sure sourcemaps have a proper path and do not // leak local paths https://github.com/webpack/webpack/issues/3603 devtoolNamespace: appName, - devtoolModuleFilenameTemplate(info) { + devtoolModuleFilenameTemplate(info: any) { const rootDir = process.cwd(); const rel = path.relative(rootDir, info.absoluteResourcePath); return `webpack:///${appName}/${rel}`;