1 Star 0 Fork 0

halo / webpack-vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
halo 提交于 2021-06-29 16:07 . init
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
const config = {
mode: 'production',
entry: {
app: './src/index.js',
},
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
port: 1991,
},
plugins: [
new HtmlWebpackPlugin({
title: 'webpack & vue',
template: './public/index.html',
}),
new CleanWebpackPlugin({ dry: true }),
new VueLoaderPlugin(),
],
module: {
rules: [
{
test: /\.vue$/,
use: ['vue-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
output: {
path: path.resolve(__dirname, 'dist'),
// filename: "[name].bundle.js",
filename: '[name].[chunkhash].js',
clean: true,
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
performance: { hints: false },
}
module.exports = config
JavaScript
1
https://gitee.com/haloxy/webpack-vue.git
git@gitee.com:haloxy/webpack-vue.git
haloxy
webpack-vue
webpack-vue
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891