項目是使用vue-cli生成的
npm run dev可以正常訪問。
npm run build報錯,錯誤信息如下
building for production...Error processing file:
static/css/app.104df4065122c4f2c7a136e88a4e9c00.css (node:2780)
UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ? in
JSON at position 111054at JSON.parse (<anonymous>) at new SourceMapConsumer (F:\work\ror\test\buefy-sample\node_modules\_source-map@0.5.7@source-map\lib\source-map-consumer.js:17:22) at PreviousMap.consumer (F:\work\ror\test\buefy-sample\node_modules\_postcss@5.2.18@postcss\lib\previous-map.js:69:34) at new Input (F:\work\ror\test\buefy-sample\node_modules\_postcss@5.2.18@postcss\lib\input.js:84:28) at parse (F:\work\ror\test\buefy-sample\node_modules\_postcss@5.2.18@postcss\lib\parse.js:21:17) at new LazyResult (F:\work\ror\test\buefy-sample\node_modules\_postcss@5.2.18@postcss\lib\lazy-result.js:70:24) at Processor.process (F:\work\ror\test\buefy-sample\node_modules\_postcss@5.2.18@postcss\lib\processor.js:117:12) at Function.cssnano.process (F:\work\ror\test\buefy-sample\node_modules\_cssnano@3.10.0@cssnano\dist\index.js:306:55) at OptimizeCssAssetsPlugin.processCss (F:\work\ror\test\buefy-sample\node_modules\_optimize-css-assets-webpack-plugin@3.2.0@optimize-css-assets-webpack-plugin\index.js:63:19) at Object.processor (F:\work\ror\test\buefy-sample\node_modules\_optimize-css-assets-webpack-plugin@3.2.0@optimize-css-assets-webpack-plugin\index.js:29:23) at F:\work\ror\test\buefy-sample\node_modules\_last-call-webpack-plugin@2.1.2@last-call-webpack-plugin\index.js:139:8 at arrayEach (F:\work\ror\test\buefy-sample\node_modules\_lodash@4.17.5@lodash\_arrayEach.js:15:9) at forEach (F:\work\ror\test\buefy-sample\node_modules\_lodash@4.17.5@lodash\forEach.js:38:10) at LastCallWebpackPlugin.process (F:\work\ror\test\buefy-sample\node_modules\_last-call-webpack-plugin@2.1.2@last-call-webpack-plugin\index.js:136:3) at Compilation.<anonymous> (F:\work\ror\test\buefy-sample\node_modules\_last-call-webpack-plugin@2.1.2@last-call-webpack-plugin\index.js:194:12) at next (F:\work\ror\test\buefy-sample\node_modules\_tapable@0.2.8@tapable\lib\Tapable.js:204:14)(node:2780) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was
not handled with .catch(). (rejection id: 2) (node:2780) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
webpack.base.conf.js如下
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
require('babel-polyfill')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: ['babel-polyfill', './src/main.js'],
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
package.json
{
"name": "buefy-sample",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "*****",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"buefy": "^0.6.5",
"bulma": "^0.7.1",
"mdi": "^2.2.43",
"vue": "^2.5.2",
"vue-i18n": "^7.6.0",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
main.js
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
import Buefy from 'buefy';
import 'buefy/lib/buefy.css';
import 'bulma/css/bulma.css';
import routes from './config/routers.js';
import './assets/css/style.css';
import 'mdi/css/materialdesignicons.css';
import VueI18n from 'vue-i18n';
Vue.use(VueI18n);
Vue.use(VueRouter);
Vue.use(Buefy);
Vue.config.productionTip = false;北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產(chǎn)業(yè)鏈。利用北京大學優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓領(lǐng)域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務(wù)負責iOS教學及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。