使用webpack4搭建vue,无法找到页面
const path = require('path');
const merge = require('webpack-merge');
const base = require('./webpack.base.js');
var webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
app: path.resolve( __dirname, './src/main.js' ),
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'server')
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.vue$/,
loader: 'vue-loader', /* 原来的'vue'改成'vue-loader' */
options: {
// vue-loader options go here
}
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
devtool: 'inline-source-map',
devServer: {
contentBase: './server'
},
plugins: [
//new CleanWebpackPlugin(['dist']),
// new HtmlWebpackPlugin({
// title: 'Output Management'
// }),
new VueLoaderPlugin()
]
};
目录的结构
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的publicPath没有写