Giter Club home page Giter Club logo

Comments (6)

colelawrence avatar colelawrence commented on June 8, 2024

Jade-loader is really good for templates, but it is not so common a practice to use webpack build system to generate html files.

I assume you are referring to something that the ExtractTextPlugin in combination with jade-html-loader would accomplish. based on Issue 15

var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
    module: {
        loaders: [
            { test: /^index\.jade$/, loader: ExtractTextPlugin.extract("jade-html-loader") }
        ]
    },
    plugins: [
        new ExtractTextPlugin("index.html")
    ]
}

from pug-loader.

CharlieGreenman avatar CharlieGreenman commented on June 8, 2024

Interesting, I used jade-html-loader, and found it to not work to my liking based on two reasons:

  1. I need different output channels for my html than my js. (webpack by default only has one so I decided to go back and stick with the system)
  2. I would have to learn the api to prettify the html, which documentation wasn't so great at.

The above being said, would you say that webpack at this time, or this loader in particular rather, is mostly for individuals using mv's such as React?

from pug-loader.

colelawrence avatar colelawrence commented on June 8, 2024

Personally, for simplicity of project structure, I try to use webpack strictly for JavaScript module management. Then, I will use gulp for my CSS and HTML pipelines.

In my current SPA AngularJS project, I don't generate any html files, I have a simple index file which loads the bundle.js and bundle.css. If I were developing a multiple page app, I would be developing it with a Sencha Connect (Express JS) server in conjunction with jade as a render engine.

from pug-loader.

CharlieGreenman avatar CharlieGreenman commented on June 8, 2024

Awesome, will definitely take a look at the project. Ok, so one last question, in other words my build system for gulp https://github.com/CharlieGreenman/Gulp-with-foundation-and-sass. Really does not have to use Webpack, nor should it be doing so? Any recommendations would be incredibly appreciated.

from pug-loader.

colelawrence avatar colelawrence commented on June 8, 2024

@CharlieGreenman looking at your project, I would judge that you would only benefit from webpack if you truly utilize it's capabilities.

I expected that you were rebasing your project from RequireJS to Webpack, because Webpack is kind of an awesome hugely modular version of the RequireJS project.

Webpack is kind of like the node.js node_modules package system for the browser. So, in my project I can write:

var $ = require('jquery')

$.ready(()=> {
  console.log("do stuff")
})

and Webpack can generate a bundle.js file that includes jquery in my package, but does not export it globally (to the window scope).
Which can do fantastic things for minificaton for example.

I would tell you to look over the react-starter, but the webpack.config.js is very complex for learning from. But you can draw some insight from some of the source files, because they demonstrate how powerful webpack can be for codebase organization.

from pug-loader.

TimothyGu avatar TimothyGu commented on June 8, 2024

@CharlieGreenman, do you still have a question about this? I'll close the issue but feel free to comment or email me (check my GitHub page for email address) if you need some more help.

from pug-loader.

Related Issues (20)

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.