【发布时间】:2019-07-20 09:30:00
【问题描述】:
我正在尝试使用 parcel.js 和 SCSS 来使用背景图像,但得到:
Uncaught SyntaxError: Unexpected token
或者有时得到:
无法读取 null 的属性“js”
这是我的 scss:
.hero{
background-image: url('../../images/2ndpaper.jpg');
}
这是我的 js:
import "../styles/index.scss";
import paperbg from "../images/2ndpaper.jpg";
这是我的 package.json:
{
"name": "development",
"version": "1.0.0",
"description": "CB PC - Web Development",
"main": "index.js",
"scripts": {
"dev": "parcel src/index.html",
"build": "parcel build src/index.html --out-dir prod"
},
"keywords": [
"client",
"website"
],
"author": "Designs by Harp",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"parcel-bundler": "^1.11.0"
},
"dependencies": {
"bootstrap-4-grid": "^2.4.1",
"gsap": "^2.0.2",
"jshint": "^2.10.1",
"sass": "^1.17.2"
}
}
可能出了什么问题?
【问题讨论】:
-
你解决了吗?
标签: javascript sass parceljs