This commit is contained in:
Henning Dieterichs
2023-09-07 15:00:50 +02:00
parent d45dfdaa71
commit a9656e1e12
37 changed files with 5502 additions and 3664 deletions

View File

@@ -1,9 +1,9 @@
import * as webpack from "webpack";
import path = require("path");
import HtmlWebpackPlugin = require("html-webpack-plugin");
import MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
import ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import * as HtmlWebpackPlugin from "html-webpack-plugin";
import * as path from "path";
import * as webpack from "webpack";
import ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
import MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const r = (file: string) => path.resolve(__dirname, file);
@@ -13,7 +13,7 @@ module.exports = {
path: r("dist"),
filename: "[name].js",
chunkFilename: "[name]-[hash].js",
devtoolModuleFilenameTemplate: info => {
devtoolModuleFilenameTemplate: (info: any) => {
let result = info.absoluteResourcePath.replace(/\\/g, "/");
if (!result.startsWith("file:")) {
// Some paths already start with the file scheme.
@@ -30,10 +30,10 @@ module.exports = {
rules: [
{
test: /\.less$/,
loaders: ["style-loader", "css-loader", "less-loader"],
use: ["style-loader", "css-loader", "less-loader"],
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.scss$/, loader: "style-loader!css-loader!sass-loader" },
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
{ test: /\.scss$/, use: ["style-loader", "css-loader", "sass-loader"] },
{
test: /\.(jpe?g|png|gif|eot|ttf|svg|woff|woff2|md)$/i,
loader: "file-loader",
@@ -45,9 +45,9 @@ module.exports = {
},
],
},
node: {
/*node: {
fs: "empty",
},
},*/
plugins: (() => {
const plugins: any[] = [
new HtmlWebpackPlugin({
@@ -55,10 +55,13 @@ module.exports = {
}),
new ForkTsCheckerWebpackPlugin(),
new CleanWebpackPlugin(),
new MonacoWebpackPlugin({
new webpack.DefinePlugin({
"process.env": JSON.stringify(process.env),
}),
/*new MonacoWebpackPlugin({
// Add more languages here once webworker issues are solved.
languages: ["typescript"],
}),
}),*/
];
return plugins;