Git Product home page Git Product logo

html-webpack-simple-include-plugin's People

Contributors

mfoitzik avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mtekman

html-webpack-simple-include-plugin's Issues

Changes doesn't effect on hot reload.

Changes doesn't effect on hot reload. I have to restart the server to see the changes made on partial components created by this plugin.

my webpack.config.js file

const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const fs = require('fs');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const HtmlWebpackSimpleIncludePlugin = require("html-webpack-simple-include-plugin");

module.exports = {
entry: {
main: "./src/index.js",
},
mode: "development",
devServer: {
watchFiles: ["src/**/*"],
hot: true,
},
module: {
rules: [
{
test: /.css$/i,
include: path.resolve(__dirname, "src"),
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader',
],
},
{
test: /.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
}
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'styles.css',
}),
new CopyPlugin({
patterns: [
{ from: "src/assets", to: "assets" }
],
}),
new HtmlWebpackPlugin({
template: "src/index.html",
}),
new HtmlWebpackPlugin({
filename: "about.html",
template: "src/about.html",
}),
new HtmlWebpackSimpleIncludePlugin([
{
tag: '',
content: fs.readFileSync(path.resolve(__dirname, "src/partials/footer.html")),

  },
  {
    tag: '<include-header />',
    content: fs.readFileSync(path.resolve(__dirname, "src/partials/header.html")),
  }
])

],
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
clean: true,
},
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.