123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- // 存放dev配置
- const merge = require('webpack-merge');
- const webpack = require('webpack');
- const baseConfig = require('./webpack.base.conf');
- const path = require('path');
- module.exports = merge(baseConfig, {
- mode: "development",
- devtool: 'inline-source-map',
- module: {
- rules: [
- {
- test: /\.(sa|sc|c)ss$/,
- use: [
- {
- loader: 'vue-style-loader',
- options: {
- publicPath: '../'
- }
- },
- 'css-loader',
- 'postcss-loader',
- 'sass-loader',
- ],
- },
- {
- test: /\.less$/,
- use: [
- {
- loader: 'vue-style-loader',
- options: {
- publicPath: '../'
- }
- },
- 'css-loader',
- 'postcss-loader',
- 'less-loader',
- ],
- },
- ]
- },
- devServer: {
- contentBase: path.resolve(__dirname, '../dist'), //告诉服务其从哪提供内容
- hot: true,
- open: true,
- host: '192.168.1.226'
- },
- plugins: [
- new webpack.HotModuleReplacementPlugin(), // 开启热更新
- new webpack.DefinePlugin({
- 'process.env': require('../config/dev.env')
- }), // 配置请求地址
- ]
- })
|