@ -6,15 +6,17 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin' ;
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin' ;
import VueLoader from 'vue-loader' ;
import VueLoader from 'vue-loader' ;
import EsBuildLoader from 'esbuild-loader' ;
import EsBuildLoader from 'esbuild-loader' ;
import { resolve , parse , dirname } from 'path' ;
import { parse , dirname } from 'path' ;
import webpack from 'webpack' ;
import webpack from 'webpack' ;
import { fileURLToPath } from 'url' ;
import { fileURLToPath } from 'url' ;
const { VueLoaderPlugin } = VueLoader ;
const { VueLoaderPlugin } = VueLoader ;
const { ESBuildMinifyPlugin } = EsBuildLoader ;
const { ESBuildMinifyPlugin } = EsBuildLoader ;
const { SourceMapDevToolPlugin } = webpack ;
const { SourceMapDevToolPlugin } = webpack ;
const _ _dirname = dirname ( fileURLToPath ( import . meta . url ) ) ;
const glob = ( pattern ) => fastGlob . sync ( pattern , {
const glob = ( pattern ) => fastGlob . sync ( pattern , { cwd : _ _dirname , absolute : true } ) ;
cwd : dirname ( fileURLToPath ( new URL ( import . meta . url ) ) ) ,
absolute : true ,
} ) ;
const themes = { } ;
const themes = { } ;
for ( const path of glob ( 'web_src/less/themes/*.less' ) ) {
for ( const path of glob ( 'web_src/less/themes/*.less' ) ) {
@ -43,29 +45,29 @@ export default {
mode : isProduction ? 'production' : 'development' ,
mode : isProduction ? 'production' : 'development' ,
entry : {
entry : {
index : [
index : [
resolve ( _ _dirname , 'web_src/js/jquery.js' ) ,
fileURLToPath ( new URL ( 'web_src/js/jquery.js' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/fomantic/build/semantic.js' ) ,
fileURLToPath ( new URL ( 'web_src/fomantic/build/semantic.js' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/js/index.js' ) ,
fileURLToPath ( new URL ( 'web_src/js/index.js' , import . meta . url ) ) ,
resolve ( _ _dirname , 'node_modules/easymde/dist/easymde.min.css' ) ,
fileURLToPath ( new URL ( 'node_modules/easymde/dist/easymde.min.css' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/fomantic/build/semantic.css' ) ,
fileURLToPath ( new URL ( 'web_src/fomantic/build/semantic.css' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/less/misc.css' ) ,
fileURLToPath ( new URL ( 'web_src/less/misc.css' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/less/index.less' ) ,
fileURLToPath ( new URL ( 'web_src/less/index.less' , import . meta . url ) ) ,
] ,
] ,
swagger : [
swagger : [
resolve ( _ _dirname , 'web_src/js/standalone/swagger.js' ) ,
fileURLToPath ( new URL ( 'web_src/js/standalone/swagger.js' , import . meta . url ) ) ,
resolve ( _ _dirname , 'web_src/less/standalone/swagger.less' ) ,
fileURLToPath ( new URL ( 'web_src/less/standalone/swagger.less' , import . meta . url ) ) ,
] ,
] ,
serviceworker : [
serviceworker : [
resolve ( _ _dirname , 'web_src/js/serviceworker.js' ) ,
fileURLToPath ( new URL ( 'web_src/js/serviceworker.js' , import . meta . url ) ) ,
] ,
] ,
'eventsource.sharedworker' : [
'eventsource.sharedworker' : [
resolve ( _ _dirname , 'web_src/js/features/eventsource.sharedworker.js' ) ,
fileURLToPath ( new URL ( 'web_src/js/features/eventsource.sharedworker.js' , import . meta . url ) ) ,
] ,
] ,
... themes ,
... themes ,
} ,
} ,
devtool : false ,
devtool : false ,
output : {
output : {
path : resolve ( _ _dirname , 'public' ) ,
path : fileURLToPath ( new URL ( 'public' , import . meta . url ) ) ,
filename : ( { chunk } ) => {
filename : ( { chunk } ) => {
// serviceworker can only manage assets below it's script's directory so
// serviceworker can only manage assets below it's script's directory so
// we have to put it in / instead of /js/
// we have to put it in / instead of /js/
@ -165,7 +167,7 @@ export default {
} ,
} ,
{
{
test : /\.svg$/ ,
test : /\.svg$/ ,
include : resolve ( _ _dirname , 'public/img/svg' ) ,
include : fileURLToPath ( new URL ( 'public/img/svg' , import . meta . url ) ) ,
type : 'asset/source' ,
type : 'asset/source' ,
} ,
} ,
{
{