【发布时间】:2018-11-08 17:25:18
【问题描述】:
我是编码新手,我正在尝试做讲师正在做的事情。我们正在研究 webpacks 但每次我尝试使用它提出的命令“npx webpack” /home/ubuntu/workspace/assignment1/hellowp/webpack.config.json:JSON 中位置 0 处的意外标记 m"
我该如何解决这个问题?
module.exports = {
entry: './src/app.js',
output: {
filename: 'app.bundle.js',
path: __dirname + '/dist'
}
};
package.json:
{
"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"
}
}
app.js
import $ from "jquery";
$(document).ready(function(){
$('#intro').html("Hello Webpack");
})
<div id = 'intro'></p>
<script src='./dist/app.bundle.js'></script>
//whats in my html
【问题讨论】:
标签: javascript jquery css json syntax