-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
- This is a bug
- This is a modification request
Code
// webpack.config.js
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
const babelLoaderOptions = {
rootMode: 'upward',
plugins: [['react-refresh/babel', { skipEnvCheck: true }]],
}
const extensions = ['.tsx', '.ts', '.js']
module.exports = {
mode: 'development',
entry: ['./src/index.js', './src/index.scss'],
output: {
publicPath: '/',
},
stats: 'errors-only',
devServer: {
client: {
overlay: true,
},
historyApiFallback: true,
port: 3000,
static: false,
},
plugins: [
new HtmlWebpackPlugin({ template: 'raw-loader!src/index.html' }),
new webpack.HotModuleReplacementPlugin(),
new ReactRefreshWebpackPlugin(),
],
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: babelLoaderOptions,
},
{
loader: 'ts-loader',
options: {
projectReferences: true,
},
},
],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: babelLoaderOptions,
},
},
{
test: /\.s?css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.html$/,
use: [
{
loader: 'ejs-html-loader',
},
],
},
{
test: /\.(ico|png|jpg|jpeg|gif)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
use: [
{
loader: 'file-loader',
},
],
},
],
},
resolve: {
extensions,
plugins: [new TsconfigPathsPlugin({ extensions })],
},
}
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Sample</title>
</head>
<body>
<div id="application" class="root">
Sample
</div>
</body>
</html>
Please paste the results of webpack-cli info
here, and mention other relevant information
Expected Behavior
Loads the website
Actual Behavior
For Bugs; How can we reproduce the behavior?
Not entirely sure other than to use webpack-dev-server 4.0.0-beta.3, with the above webpack configuration.
I'm not able to find out exactly what is causing this issue given the limited output.
For Features; What is the motivation and/or use-case for the feature?
aerialist7
Metadata
Metadata
Assignees
Labels
No labels