1 Star 0 Fork 33

林波 / noob-admin-ui

forked from 辰小白 / noob-admin-ui 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
辰小白 提交于 2021-02-09 15:29 . 搜索自适应
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require("clean-webpack-plugin");
const path = require('path');
module.exports = {
devServer: {
host: '127.0.0.1',
port: 7180
},
entry: './src/main.js',
output: {
filename: 'bundle.[hash].js'
},
module: {
rules: [
{
test: /\.vue$/,
use: ['vue-loader']
},
{
test: /\.css$/,
use: [{
loader: 'vue-style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'px2rem-loader',
// options here
options: {
remUnit: 50,
remPrecision: 8
}
}]// 直接插入到style标签中
},
{
test: /\.(eot|svg|png|jpg|ttf|woff|woff2)(\?\S*)?$/,
loader: 'file-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({ // 此插件必须位于插件数组的首位
template: './src/index.html',// 指定模板html文件
filename: './index.html',// 输出的html文件名称
favicon: path.resolve('./src/assets/img/favicon.png'), //标签页图片
inject: true,
}),
new VueLoaderPlugin(),
new CleanWebpackPlugin()
],
// externals: {
// 'AMap': 'window.AMap'
// }
};
1
https://gitee.com/linbo20010131/noob-admin-ui.git
git@gitee.com:linbo20010131/noob-admin-ui.git
linbo20010131
noob-admin-ui
noob-admin-ui
master

搜索帮助