加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
SakumyZ 提交于 2019-02-03 00:32 . change vue-resource to axios
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
entry: './src/index.js',
devtool: 'inline-source-map',
mode: 'development',
devServer: {
contentBase: './dist',
hot: true,
},
plugins: [
new HtmlWebpackPlugin({
title: 'Vue项目练习',
template: path.join(__dirname, './src/index.html'),
filename: 'index.html'
}),
new webpack.HotModuleReplacementPlugin(),
new VueLoaderPlugin()
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss|sass$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ['file-loader']
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: ['file-loader']
},
{
test: /\.js$/,
use: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.vue$/,
use: ['vue-loader']
}
]
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化