Upgraded entries, plugins, router & webpack to vue 3 & typescript

This commit is contained in:
2022-08-06 16:14:44 +02:00
parent d279298dec
commit 96c412ca49
11 changed files with 406 additions and 373 deletions

View File

@@ -7,7 +7,7 @@ const TerserPlugin = require("terser-webpack-plugin");
const sourcePath = path.resolve(__dirname, "src");
const indexFile = path.join(sourcePath, "index.html");
const javascriptEntry = path.join(sourcePath, "main.js");
const javascriptEntry = path.join(sourcePath, "main.ts");
const publicPath = path.resolve(__dirname, "public");
const isProd = process.env.NODE_ENV === "production";
@@ -36,9 +36,12 @@ module.exports = {
use: ["vue-loader"]
},
{
test: /\.tsx?$/,
test: /\.ts$/,
loader: "ts-loader",
exclude: /node_modules/
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/]
}
},
{
test: /\.scss$/,
@@ -69,7 +72,7 @@ module.exports = {
resolve: {
extensions: [".js", ".ts", ".vue", ".json", ".scss"],
alias: {
vue$: "vue/dist/vue.common.js",
vue: "@vue/runtime-dom",
"@": path.resolve(__dirname, "src"),
src: path.resolve(__dirname, "src"),
assets: `${publicPath}/assets`,