webpack devServer 3.1.3 застрял в списке каталогов

Попытка добавить response-hot-loading v4.1.1 через веб-пакет devServer, однако, когда я запускаю dev-сервер, я получаю только список каталогов, примерный компонент response будет работать, если я просто запусту 'запуск пряжи' из созданного комплекта. JS.

Я читал похожие проблемы с пробелами, создавая ошибки, но я не думаю, что у меня их есть. Любая помощь приветствуется.

const webpack = require('webpack');
const path = require('path');
const { resolve } = require('path');


const jsProdOutput = {
  filename: 'public/javascripts/build.js',
  path: resolve(__dirname),
  publicPath: '/',
};

module.exports = {
  context: resolve(__dirname, 'src'),
  entry: [
    './index.jsx',
  ],
  devtool: 'inline-source-map',
  devServer: {
    contentBase: path.join('/', 'src'),
    hotOnly: true,
    port: 8080,
    hot: true,
    inline: true,
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NamedModulesPlugin(),
  ],
  output: jsProdOutput,
  resolve: {
    extensions: ['.js', '.jsx'],
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules|bower_components|public\/)/,
        loader: 'babel-loader',
      },
      {
        test: /\.jsx?$/,
        exclude: /(node_modules|bower_components|public\/)/,
        loader: 'babel-loader',
      },
    ],
  },
};

{
  "name": "personalwebsitev2",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www",
    "lint": "eslint .",
    "build-prod": "webpack --config webpack.config.js --progress --profile --colors",
    "start-w": "webpack-dev-server --mode development"
  },
  "dependencies": {
    "babel-core": "^6.26.0",
    "babel-jest": "^22.4.3",
    "babel-loader": "^7.1.4",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "body-parser": "~1.18.2",
    "clean-webpack-plugin": "^0.1.19",
    "cookie-parser": "~1.4.3",
    "debug": "~2.6.9",
    "ejs": "^2.5.9",
    "ejs-loader": "^0.3.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.11.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
    "express": "^4.16.3",
    "morgan": "~1.9.0",
    "node-sass": "^4.8.3",
    "nodemon": "^1.17.3",
    "npm": "^5.8.0",
    "optional": "^0.1.4",
    "raw-loader": "^0.5.1",
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "reactstrap": "^5.0.0",
    "sass-loader": "^7.0.1",
    "serve-favicon": "~2.4.5",
    "supertest": "^3.0.0",
    "webpack": "^4.6.0"
  },
  "devDependencies": {
    "eslint": "^4.19.1",
    "eslint-plugin-jest": "^21.15.1",
    "html-webpack-plugin": "^3.2.0",
    "jest": "^22.4.3",
    "react-hot-loader": "^4.1.1",
    "webpack-cli": "^2.0.15",
    "webpack-dev-server": "^3.1.3"
  }
}

0 ответов

Другие вопросы по тегам