-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support extract jade ? #10
Comments
That should work – provided that you included the |
Late to the party, but: The The HTML loader expects a string of HTML as input, so it's not able to process the result (which is JavaScript code). You can use the Also, you need to test for the input file (is Example: // webpack config module.loaders:
{
test: /\.jade$/,
loaders: [ "file?name=[name].html", "extract", "html", "apply", "jade" ]
}
// your code:
const htmlUrl = require( './views/index.jade' ); |
@jpommerening Wow, that's genius. Would you be open to add a test/example for that to the extract-loader? :D |
Very late to the party 😄 @jpommerening This was the solution I came up with as well, but it doesn't seem to be working. I was wondering if you could take a look to see if I'm missing something obvious. My webpack config module.loaders: {
test: /\.pug$/,
loaders: [
{
loader: 'file-loader',
options: { name: '[path][name].html' }
},
'extract-loader',
'html-loader',
'apply-loader',
'pug-loader'
]
} This generates the correct html files, but their contents are off. For instance, each html file will be something like:
...instead of the expected HTML. I've tried a similar setup with Removing
Greatly appreciate some help! |
@markbrouch will you please share this config? |
@markbrouch : I have the same issue (or similar at least), did you ever resolve it? Pug rule:
Other stuff:
Resulting "HTML" file:
|
this one works const pugOpts = {
loader: 'pug-html-loader',
options: {
data: {
version,
_global: {}
}
}
}
{
test: /\.pug$/,
use: [
'file-loader?name=index.html',
{
loader: 'extract-loader',
options: {
publicPath: ''
}
},
'html-loader',
pugOpts
]
} |
I found that my problem wasn't due to configuration, it was a bug regarding circular dependencies which I've logged separately with an example #39 . I found that after switching from |
I'm using Jade, and can I compile my index.jade to index.html then extract it ?
Here's my trial but failed:
var indexHtml = __dirname + '/src/views/index.html';
{ test: indexHtml, loaders: [ "file?name=[name].[ext]", "extract", "html", "jade" ] }
Any Help? Many thanks ~
The text was updated successfully, but these errors were encountered: