notebooks/workspaces/frontend/webpack.dev.js

35 lines
780 B
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const { stylePaths } = require('./stylePaths');
const HOST = process.env.HOST || 'localhost';
const PORT = process.env.PORT || '9000';
module.exports = merge(common('development'), {
mode: 'development',
devtool: 'eval-source-map',
devServer: {
host: HOST,
port: PORT,
historyApiFallback: true,
open: true,
static: {
directory: path.resolve(__dirname, 'dist')
},
client: {
overlay: true
}
},
module: {
rules: [
{
test: /\.css$/,
include: [...stylePaths],
use: ['style-loader', 'css-loader']
}
]
}
});