trying to set up webpack to run these files in the web, and close? I think?

This commit is contained in:
talksik
2022-05-08 14:47:40 -05:00
parent cd5e7d8c4b
commit 7d605bf7f9
3 changed files with 225 additions and 6 deletions
+42
View File
@@ -0,0 +1,42 @@
const rules = require("./webpack.rules");
const plugins = require("./webpack.plugins");
const path = require("path");
rules.push({
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{
loader: "postcss-loader",
options: {
postcssOptions: {
config: path.join(__dirname, "postcss.config.js"),
},
},
},
],
});
module.exports = {
mode: "development",
entry: "./src/app.tsx",
module: {
rules,
},
plugins: plugins,
resolve: {
extensions: [".js", ".ts", ".jsx", ".tsx", ".css"],
},
output: {
path: path.resolve(__dirname, "build"),
filename: "bundle.js",
},
devServer: {
static: path.join(__dirname, "build"),
compress: true,
port: 4000,
},
};