我正在努力寻找这个意外错误的解决方案,当我运行开发时它工作正常,但当我推送到Heroku时它给我错误请帮我解决这个问题。
我的Webpack Configeration
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
resolve: {
alias: {
'vue$': 'vue/dist/vue.js'
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader',
js: 'babel-loader'
}
}
},
{
test: /\.js$/,
use: {
loader: 'babel-loader',
}
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
inject: true,
hash: false,
template: './pages/template.html',
minify: {
removeComments: true,
collapseWhitespace: true,
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: false,
}
})
],
我的package.js设置
{
"name": "vue-fullpage.js",
"version": "0.0.1",
"description": "buzzelement Website App",
"main": "./src/FullPage.vue",
"scripts": {
"dev": "webpack-dev-server --config=webpack.config.dev.js",
"start": "node server.js",
"main": "webpack --config=webpack.config.js pages/main/src/index.js pages/main/dist/build.js",
"stand-alone": "concurrently 'webpack --config=webpack.config.build.js src/FullPage.vue pages/stand-alone/build.min.js --output-library=fullPage' 'webpack --config=webpack.config.build.js src/fullPageMixin.js pages/stand-alone/mixin.min.js --output-library=fullPageMixin'",
"build": "webpack --config=webpack.config.build.js src/FullPage.vue dist/build.min.js --output-library=fullPage",
"mixin": "webpack --config=webpack.config.build.js src/fullPageMixin.js dist/mixin.min.js --output-library=fullPageMixin",
"heroku-postbuild": "npm run main"
},
"repository": {
"type": "git",
"url": "msaqib83@bitbucket.org/buzzelement/buzzelement-com.git"
},
"dependencies": {
"express": "4.16.3",
"foobar": "^1.1.0",
"jquery": ">=1.6.0",
"style-loader": "^0.20.2",
"vue": "^2.5.13",
"vue-awesome-swiper": "^3.1.2",
"vue2-google-maps": "^0.8.8"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"bootstrap-vue": "^2.0.0-rc.1",
"concurrently": "^3.5.1",
"copy-webpack-plugin": "^4.3.1",
"css-loader": "^0.28.11",
"html-webpack-plugin": "^2.30.1",
"uglifyjs-webpack-plugin": "^1.2.4",
"vue-loader": "^13.6.0",
"vue-template-compiler": "^2.5.13",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.7"
},
"engines": {
"node": "8.7.0",
"npm": "5.8.0",
"yarn": "1.2.0"
}
}
如果有人帮助我解决这个问题我会在这里尝试很多但是找不到合适的答案会很棒