I am brand new to coding and am currently trying to follow the lecturer's instructions on webpacks. However, every time I attempt to use the command "npx webpack", I encounter this error message: "/home/ubuntu/workspace/assignment1/hellowp/webpack.config.json: Unexpected token m in JSON at position 0"
Could someone please advise me on how to resolve this issue?
module.exports = {
entry: './src/app.js',
output: {
filename: 'app.bundle.js',
path: __dirname + '/dist'
}
};
Here is my package.json file:
{
"name": "hellowp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.10.1",
"webpack-cli": "^2.1.4"
},
"dependencies": {
"jquery": "^3.3.1"
}
}
Content of app.js file:
import $ from "jquery";
$(document).ready(function(){
$('#intro').html("Hello Webpack");
})
<div id='intro'></p>
<script src='./dist/app.bundle.js'></script>
// Content within my HTML file