I created my Random Quote Machine using scrimba.com (you can see the code here: https://scrimba.com/c/cZPQ4Gc4). It works fine on scrimba’s browser, but when I downloaded it and tried to open it on Chrome it doesn’t work (or FireFox or Github Pages). The error goes as follows: “…/script.pack.js net::ERR_FILE_NOT_FOUND”, so I figured it has to do with my script src=“script.pack.js”></script, but can’t make it work nor did I found a solution. I am new to coding and would appreciate a hand. This is my webpacking conf:
module.exports = {
"output": {
"filename": "[name].pack.js"
},
"module": {
"rules": [
{
"use": {
"loader": "babel-loader",
"options": {
"presets": [
"babel-preset-env",
"babel-preset-react"
]
}
},
"exclude": /node_modules/,
"test": /\.js$/
}
]
},
"entry": {
"script": "./script"
}
};
My package.json
{
"name": "cZPQ4Gc4",
"dependencies": {
"react": "16.12.0",
"react-dom": "16.12.0",
"redux": "4.0.5",
"react-redux": "7.1.3"
},
"devDependencies": {
"webpack": "^2.0",
"babel-core": "^6.0",
"babel-loader": "^7.0",
"babel-preset-env": "*",
"babel-preset-react": "*"
},
"scripts": {
"build": "webpack",
"watch": "webpack -w"
}
}
and how my code is organized: