Comments (6)
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.
Interesting, I used jade-html-loader, and found it to not work to my liking based on two reasons:
- 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)
- 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.
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.
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.
@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.
@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)
- require a variable HOT 2
- “include” correctly imports content, but “extends/block” yields no content or errors HOT 1
- Can't get some Mixins correctly loaded: Empty mixins
- Interpolation not working
- 'module' is not a known element error HOT 7
- how to remove comments in pug template?
- Can not use require with variable in mixin HOT 6
- 'Module not found: Error: Can't resolve` when use a mixin and require on same file HOT 3
- Is this package still being maintained? HOT 43
- any support for webpack-4 or webpack-5 HOT 6
- warning " > [email protected]" has incorrect peer dependency "pug@^2.0.0". HOT 6
- Unbuffered Code Issue with variables declared at beginning of pug template when using loader HOT 3
- Raise error manually
- Angular 11 postinstal script error(solution)
- Includes and or mixins sometimes do not trigger changes in parents while watching HOT 1
- Pug > 3, pug-loader error. HOT 3
- pug-loader no longer maintained? HOT 1
- esbuild alternative HOT 4
- load a CSS file in pug file HOT 6
- Npm Audit report HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pug-loader.