Webpack + html-loader + dev-server
Здравствуйте, подскажет пожалуйста.
почему у меня не происходит перезагрузка html страницы, с js, css все хорошо. const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const merge = require('webpack-merge'); const html = require('./webpack/html'); const devserver = require('./webpack/devserver'); const sass = require('./webpack/sass'); const css = require('./webpack/css'); const extractCSS = require('./webpack/css.extract'); const uglifyJS = require('./webpack/js.uglify'); const images = require('./webpack/images'); const fonts = require('./webpack/fonts'); const reactJs = require('./webpack/React'); const PATHS = { source: path.join(__dirname, 'source'), build: path.join(__dirname, 'build') }; const common = merge([ { entry: { // dev: 'webpack-dev-server/client?http://localhost:9000' index: PATHS.source + '/js/index.js' }, output: { path: PATHS.build, filename: 'js/[name].js' }, plugins: [ new HtmlWebpackPlugin({ filename: 'index.html', chunks: ['index', 'common'], template: PATHS.source + '/index.html' }), new webpack.HotModuleReplacementPlugin() ] }, html(), reactJs(), images(), fonts() ]); module.exports = function(env) { if (env === 'production'){ return merge([ common, extractCSS(), uglifyJS() ]); } if (env === 'development'){ return merge([ common, devserver(), sass(), css() ]) } }; .babelrc { "plugins": ["react-hot-loader/babel"] } html-loader module.exports = function () { return { module: { rules: [ { test: /\.html$/, loader: 'html-loader', options: { pretty: true } } ] } } }; dev-server module.exports = function () { return { devServer: { stats: 'errors-only', port: 3000, contentBase: "/source/", hot: true, } } }; Спасибо за ранее! |
Часовой пояс GMT +3, время: 20:33. |