Replies: 7 comments 14 replies
-
does any one see this? |
Beta Was this translation helpful? Give feedback.
-
me but ido t knew i want to leading webpack and nodejs express html css tailwind |
Beta Was this translation helpful? Give feedback.
-
no one damn care. this is how webpack works ? if it works then good and if you face any kind of issue; we will not provide any kind of support/help. |
Beta Was this translation helpful? Give feedback.
-
@xkeshav Sorry for delay, still valid? If yes - please create reproducibe test repo, thank you |
Beta Was this translation helpful? Give feedback.
-
I tried your suggestion and made below changes
const path = require("path");
const nodeExternals = require("webpack-node-externals");
const plugins = require("./webpack.plugins.config");
const modules = require("./webpack.modules.config");
const BUILD_DIR = path.join(__dirname, "build");
const DIST_DIR = path.join(__dirname, "dist");
const pages = ["draw", "varnmala", "canvas", "about", "math"];
const entryObject = pages.reduce((p, n) => Object.assign(p, { [n]: [`./src/scripts/${n}.js`, `./src/styles/${n}.css`] }), {});
module.exports = {
entry: {
index: ["./src/index.js"],
server: ["./src/server/index.js"],
...entryObject
},
devServer: {
static: DIST_DIR,
compress: true,
port: 3000,
historyApiFallback: true,
open: true,
hot: true
},
output: {
path: BUILD_DIR,
publicPath: "/",
filename: "scripts/[name].js",
chunkFilename: "scripts/[name].js",
assetModuleFilename: "assets/[hash][ext][query]",
clean: true
},
mode: "development",
target: "node",
node: {
__dirname: false,
__filename: false
},
externals: [nodeExternals()],
devtool: "eval-source-map",
plugins,
module: modules,
resolve: {
extensions: [".html", ".js", ".json", ".css"]
},
optimization: {
runtimeChunk: "single"
}
}; it opens localhost:3000 but it gives Cannot Get / page |
Beta Was this translation helpful? Give feedback.
-
Hi @alexander-akait I know I have some configuration issues, that is the reason seeking for help. I have started the project keeping local only in mind and when it grows the webpack coems as rescuse but now stuck in such a way that now I cant make any changes and update the project ( even on style) as I have only build script and whenever make any changes which reflectes after build so here is the minimal setup of code . kindly help me to set up development hot reload webpack. I have tried various stack overflow/forum and even chat GPty but nonw of them seems working. this is the branch minimal ; will you please do some help. |
Beta Was this translation helpful? Give feedback.
-
I have started again with new folder structure and here is the issue mentioned-- > #18153 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have vanilla js project which use node js and express js to run and now need to build which works fine with my config but now unable to start in local.
below is my folder structure
package.json
index.js
server/server.js
webpack.plugins.config.js
webpack.modules.js
webpack.dev.config.js
when I run npm run dev it run successfully
but opening localhost:3000 gives error with can not get / message
what could be the issue.
you can see complete code here in my repo : https://github.com/xkeshav/canvas
Thanks in Advance.
Beta Was this translation helpful? Give feedback.
All reactions