homepage/config/webpack.dev.js

51 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2023-03-14 07:16:12 +00:00
const { merge } = require('webpack-merge')
const common = require('./webpack.common')
2023-03-16 07:54:45 +00:00
const paths = require('./paths')
const path = require('path');
2023-03-14 07:16:12 +00:00
module.exports = merge(common, {
// Set the mode to development or production
mode: 'development',
2023-03-16 07:54:45 +00:00
// Where webpack outputs the assets and bundles
output: {
path: path.resolve('./assets'),
filename: '[name].bundle.js',
publicPath: '/assets/',
},
2023-03-14 07:16:12 +00:00
// Control how source maps are generated
devtool: 'inline-source-map',
// Spin up a server for quick development
devServer: {
2023-03-16 07:54:45 +00:00
static: {
directory: paths.build
},
2023-03-14 07:16:12 +00:00
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 } },
],
},
],
},
})