-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: path is not defined #823
Comments
You are missing the related import. Please set |
montogeek
pushed a commit
to webpack/webpack.js.org
that referenced
this issue
Sep 2, 2018
I'm not the first person to forget this import webpack/webpack-dev-server#823
I have this code block and I am getting the error
{
"scripts": {
"build": "webpack -p --progress --config webpack.config.build.js",
"development": "webpack serve --progress --config webpack.config.development.js",
"start": "npm run development"
},
"devDependencies": {
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"mini-css-extract-plugin": "^2.7.2",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0"
}
}
const path = require('path')
const { merge } = require('webpack-merge')
const config = require('./webpack.config')
module.exports = merge(config, {
node: 'development',
devtool: 'inline-source-map',
devServer: {
writeToDisk: true,
},
output: {
path: path.resolve(__dirname, 'public')
}
}) |
My const path = require('path') It works ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to run webpack-dev-server accord the documentation, but I'm having a little problem:
webpack.config.js
devServer configuration
error
webpack version: ^2.2.1
webpack-dev-server: ^2.4.1
I forgot something?
The text was updated successfully, but these errors were encountered: