diff options
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..ce4f1da --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,59 @@ +const path = require("path"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); + +module.exports = { + entry: path.resolve(__dirname, "src/"), + plugins: [ + new HtmlWebpackPlugin({ + template: path.join(__dirname, "src/", "index.html"), + favicon: path.join(__dirname, "src/assets/", "favicon.ico") + }), + ], + module: { + rules: [ + { + test: /\.?jsx$/, + use: { + loader: "babel-loader", + options: { + presets: ["@babel/preset-env", "@babel/preset-react"] + } + }, + }, + { + test: /\.(jpg|png|svg|gif)$/, + type: "asset/resource", + }, + { + test: /\.css$/i, + use: [ + "style-loader", + { + loader: "css-loader", + options: { + importLoaders: 1, + modules: true, + }, + }, + ], + }, + { + test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/, + generator: { + filename: "[name][ext]" + } + } + ] + }, + resolve: { + modules: [path.resolve(__dirname, "src/"), "node_modules"], + alias: { + client: path.resolve(__dirname, "") + }, + extensions: [".js", ".jsx"] + }, + output: { + path: path.resolve(__dirname, "dist"), + assetModuleFilename: "[hash][ext][query]" + }, +}; |
