123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- const webpack = require('webpack')
- const merge = require('webpack-merge')
- const commonConf = require('./webpack.common.js')
- const devConf = {
- mode: 'development',
- devtool: 'cheap-module-eval-source-map',
- devServer: {
- contentBase: 'dist',
- open: true,
- hot: true,
- overlay: true,
- proxy: {
- }
- },
- module: {
- rules: [
- {
- test: /(?<!\.module)\.(scss|css)$/,
- use: [
- 'style-loader',
- {
- loader: 'css-loader',
- options: {
- importLoaders: 2
- }
- },
- 'sass-loader',
- 'postcss-loader'
- ]
- },
- {
- test: /(?<=\.module)\.(scss|css)$/,
- use: [
- 'style-loader',
- {
- loader: 'css-loader',
- options: {
- importLoaders: 2,
- modules: true
- }
- },
- 'sass-loader',
- 'postcss-loader'
- ]
- }
- ]
- },
- plugins: [
- new webpack.HotModuleReplacementPlugin()
- ]
- }
- module.exports = merge(commonConf, devConf)
|