Vuej + webpack(开发环境)在加载css后显示空白页(包括@ fonts-face)
如果我们忽略从App.vue导入style.css,问题就解决了。
控制台没有显示错误。
wepback.config.js
setvalue
style.css
of the [].forEach.call()
App.vue(主页)
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/main.js',output: {
path: path.resolve(__dirname,'./dist'),publicPath: '/dist/',filename: 'build.js'
},module: {
rules: [
{
test: /\.css$/,use: [
'vue-style-loader','css-loader'
],},{
test: /\.vue$/,loader: 'vue-loader',options: {
loaders: {
}
// other vue-loader options go here
}
},{
test: /\.js$/,loader: 'babel-loader',exclude: /node_modules/
},{
test: /\.(png|jpg|gif|svg)$/,loader: 'file-loader',options: {
name: '[name].[ext]?[hash]'
}
},{
test: /\.(woff|woff2|eot|ttf)$/,exclude: /node_modules/,loader: 'url-loader',options: {
limit: 10000
}
}
],resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},extensions: ['*','.js','.vue','.json']
},devserver: {
historyApiFallback: true,noInfo: true,overlay: true
},performance: {
hints: false
},devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),new webpack.optimize.UglifyJsPlugin({
sourceMap: true,compress: {
warnings: false
}
}),new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}
项目目录的图像