diff --git a/web/ASC.Web.Editor/next.config.js b/web/ASC.Web.Editor/next.config.js new file mode 100644 index 0000000000..163495b806 --- /dev/null +++ b/web/ASC.Web.Editor/next.config.js @@ -0,0 +1,107 @@ +const serverConfig = require("./server.config.json"); +module.exports = { + //future: { webpack5: true }, + env: { + remoteApiUrl: serverConfig.remoteApiUrl, + }, + webpack: (config, options) => { + return { + ...config, + plugins: [...config.plugins], + experiments: { topLevelAwait: true }, + module: { + rules: [ + ...config.module.rules, + + { + test: /\.(png|jpe?g|gif|ico)$/i, + type: "asset/resource", + generator: { + filename: "static/images/[hash][ext][query]", + }, + }, + { + test: /\.m?js/, + type: "javascript/auto", + resolve: { + fullySpecified: false, + }, + }, + { + test: /\.react.svg$/, + use: [ + { + loader: "@svgr/webpack", + options: { + svgoConfig: { + plugins: [{ removeViewBox: false }], + }, + }, + }, + ], + }, + { test: /\.json$/, loader: "json-loader" }, + { + test: /\.css$/i, + use: ["style-loader", "css-loader"], + }, + { + test: /\.s[ac]ss$/i, + use: [ + // Creates `style` nodes from JS strings + "style-loader", + // Translates CSS into CommonJS + { + loader: "css-loader", + options: { + url: { + filter: (url, resourcePath) => { + // resourcePath - path to css file + + // Don't handle `/static` urls + if ( + url.startsWith("/static") || + url.startsWith("data:") + ) { + return false; + } + + return true; + }, + }, + }, + }, + // Compiles Sass to CSS + "sass-loader", + ], + }, + + { + test: /\.(js|jsx)$/, + exclude: /node_modules/, + use: [ + { + loader: "babel-loader", + options: { + presets: ["@babel/preset-react", "@babel/preset-env"], + plugins: [ + "@babel/plugin-transform-runtime", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-export-default-from", + ], + }, + }, + "source-map-loader", + ], + }, + ], + }, + }; + }, + + webpackDevMiddleware: (config) => { + // Perform customizations to webpack dev middleware config + // Important: return the modified config + return config; + }, +}; diff --git a/web/ASC.Web.Editor/server.config.json b/web/ASC.Web.Editor/server.config.json new file mode 100644 index 0000000000..08c7f7d6cb --- /dev/null +++ b/web/ASC.Web.Editor/server.config.json @@ -0,0 +1,3 @@ +{ + "remoteApiUrl": "http://192.168.0.12:8092" +} \ No newline at end of file