12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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',
- output: {
- filename: 'js/[name]_[hash:5].js',
- },
- devServer: {
- contentBase: 'dist',
- host:'127.0.0.1',
- 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(),
- new webpack.DefinePlugin({
- DEV: JSON.stringify(true)
- })
- ]
- }
- module.exports = merge(commonConf, devConf)
|