39 lines
906 B
JavaScript
39 lines
906 B
JavaScript
|
const { merge } = require('webpack-merge')
|
||
|
|
||
|
const common = require('./webpack.common')
|
||
|
|
||
|
module.exports = merge(common, {
|
||
|
// Set the mode to development or production
|
||
|
mode: 'development',
|
||
|
|
||
|
// Control how source maps are generated
|
||
|
devtool: 'inline-source-map',
|
||
|
|
||
|
// Spin up a server for quick development
|
||
|
devServer: {
|
||
|
historyApiFallback: true,
|
||
|
open: true,
|
||
|
compress: true,
|
||
|
hot: true,
|
||
|
port: 8080,
|
||
|
},
|
||
|
|
||
|
module: {
|
||
|
rules: [
|
||
|
// Styles: Inject CSS into the head with source maps
|
||
|
{
|
||
|
test: /\.(sass|scss|css)$/,
|
||
|
use: [
|
||
|
'style-loader',
|
||
|
{
|
||
|
loader: 'css-loader',
|
||
|
options: { sourceMap: true, importLoaders: 1, modules: false },
|
||
|
},
|
||
|
{ loader: 'postcss-loader', options: { sourceMap: true } },
|
||
|
{ loader: 'sass-loader', options: { sourceMap: true } },
|
||
|
],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
})
|