-
-
-
Кажется вы попали на общую страницу.
-
Чтобы перейти к форме ввелите токен ниже или снова перейдите по ссылке.
-
-
-
-
-
Перейти к нужной форме
-
-
-
-
-
- navigate(`/forms/${token}`)}/>
-
-
-
-
+ return (
+
+
+
+
+ Кажется вы попали на общую страницу.
+
+
+ Чтобы перейти к форме введите токен ниже или снова перейдите по
+ ссылке.
+
- )
-}
+
+
+
+
Перейти к нужной форме
+
+
+
+
+ setToken(e)}
+ />
+
+
+
+
+ navigate(`/forms/${token}`)}
+ />
+
+
+
+
+
+ );
+};
-export default Home;
\ No newline at end of file
+export default Home;
diff --git a/webpack.config.js b/webpack.config.js
index 40ec78b..b940708 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,73 +1,74 @@
-const HtmlWebpackPlugin = require('html-webpack-plugin');
-const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-const path = require('path');
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
+const path = require("path");
module.exports = (env) => {
+ const isDev = env.mode === "development";
- const isDev = env.mode === 'development';
+ const cssLoader = {
+ loader: "css-loader",
+ options: {
+ modules: {
+ localIdentName: isDev ? "[path][name]__[local]" : "[hash:base64:8]",
+ },
+ },
+ };
- const cssLoader = {
- loader: "css-loader",
- options: {
- modules: {
- localIdentName: isDev ? '[path][name]__[local]' : '[hash:base64:8]'
- },
+ const config = {
+ mode: env.mode ?? "development",
+ performance: {
+ hints: false,
+ maxEntrypointSize: 512000,
+ maxAssetSize: 512000,
+ },
+ entry: "./src/index.js",
+ output: {
+ // filename: '[name].[contenthash].js',
+ filename: "bundle.js",
+ publicPath: "/",
+ path: path.resolve(__dirname, "dist"),
+ clean: true,
+ },
+ plugins: [
+ new HtmlWebpackPlugin({
+ template: path.resolve(__dirname, "public", "index.html"),
+ }),
+ isDev
+ ? undefined
+ : new MiniCssExtractPlugin({
+ filename: "css/[name].[contenthash:8].css",
+ chunkFilename: "css/[name].[contenthash:8].css",
+ }),
+ ],
+ module: {
+ rules: [
+ {
+ test: /\.(scss|css)$/,
+ use: [
+ isDev ? "style-loader" : MiniCssExtractPlugin.loader,
+ cssLoader,
+ "sass-loader",
+ ],
},
- }
+ {
+ test: /\.(js|jsx)$/,
+ exclude: /node_modules/,
+ use: {
+ loader: "babel-loader",
+ options: {
+ presets: ["@babel/preset-env", "@babel/preset-react"],
+ },
+ },
+ },
+ ],
+ },
+ devServer: {
+ port: env.port ?? 3000,
+ historyApiFallback: true,
+ host: "0.0.0.0",
+ allowedHosts: "all",
+ },
+ };
- const config = {
- mode: env.mode ?? 'development',
- performance: {
- hints: false,
- maxEntrypointSize: 512000,
- maxAssetSize: 512000
- },
- entry: './src/index.js',
- output: {
- // filename: '[name].[contenthash].js',
- filename: 'bundle.js',
- publicPath: '/',
- path: path.resolve(__dirname, 'dist'),
- clean: true
- },
- plugins: [
- new HtmlWebpackPlugin({template: path.resolve(__dirname, 'public', 'index.html')}),
- isDev ? undefined : new MiniCssExtractPlugin({
- filename: 'css/[name].[contenthash:8].css',
- chunkFilename: 'css/[name].[contenthash:8].css'
- })
- ],
- module: {
- rules: [
- {
- test: /\.(scss|css)$/,
- use: [
- isDev ? 'style-loader' : MiniCssExtractPlugin.loader,
- cssLoader,
- 'sass-loader'
- ],
- },
- {
- test: /\.(js|jsx)$/,
- exclude: /node_modules/,
- use: {
- loader: "babel-loader",
- options: {
- presets: [
- '@babel/preset-env',
- '@babel/preset-react'
- ]
- }
- }
- }
- ]
- },
- devServer: {
- port: env.port ?? 3000,
- open: true,
- historyApiFallback: true
- }
- };
-
- return config
-}
\ No newline at end of file
+ return config;
+};