54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
const path = require('path');
|
|
const { VueLoaderPlugin } = require('vue-loader');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
entry: './src/main.js',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
publicPath: '/'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue-loader'
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel-loader',
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif|svg)$/,
|
|
type: 'asset/resource'
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new VueLoaderPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: './public/index.html'
|
|
})
|
|
],
|
|
resolve: {
|
|
extensions: ['.js', '.vue', '.json'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
devServer: {
|
|
static: {
|
|
directory: path.join(__dirname, 'public'),
|
|
},
|
|
historyApiFallback: true,
|
|
port: 8080,
|
|
hot: true
|
|
}
|
|
};
|