Code Monkey home page Code Monkey logo

Comments (6)

mattlewis92 avatar mattlewis92 commented on June 12, 2024 1

Far smarter people out there have done a much better job that I could do 😄

If you're just getting started here are a few resources that might help:
https://github.com/petehunt/webpack-howto
https://webpack.github.io/docs/list-of-tutorials.html
https://egghead.io/courses/using-webpack-for-production-javascript-applications

from htmlhint-loader.

mattlewis92 avatar mattlewis92 commented on June 12, 2024

As you're not using the html loader I'm assuming you're not loading the html file in your source so webpack doesn't know it exists. You need to install and configure the html loader then in ./entry.js put require('test.html')

from htmlhint-loader.

ManvendraSK avatar ManvendraSK commented on June 12, 2024

Oh, I got your point. Thanks. But it's working only when I setup the loader using

loaders: [
          {
            test: /\.html$/,
            loader: "html"
          }
        ]

and requiring the exact file require('html!./test.html'); inside entry.js. Is there any other way to watch for all the directories, and automatically lint all html files? Something like require('html!./src');.

from htmlhint-loader.

mattlewis92 avatar mattlewis92 commented on June 12, 2024

You can do that with webpack: https://webpack.github.io/docs/context.html

function requireAll(requireContext) {
  return requireContext.keys().map(requireContext);
}
requireAll(require.context("./src", true, /^\.\/.*\.html$/));

Although if you don't intend to bundle your templates with your JS you might be better off using gulp

from htmlhint-loader.

ManvendraSK avatar ManvendraSK commented on June 12, 2024

Ohk.. Thanks a lot. You seems to be a champ of Webpack. I just started learning it 2 days back. Why don't you write a book on it?

from htmlhint-loader.

ManvendraSK avatar ManvendraSK commented on June 12, 2024

😆 You are also expert IMHO! Yes I looked into that Survive.js link during my weekend. Thanks for sharing the details.

from htmlhint-loader.

Related Issues (14)

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.