-
Notifications
You must be signed in to change notification settings - Fork 2
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
Plain text output #4
Comments
I close this one by using Maybe we could add an exemple using |
One of the examples from the readme uses module.exports = {
entry: './src/index.js',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [{
test: /\.pug$/,
use: [{
loader: 'file-loader?name=[name].html'
},
{
loader: 'extract-loader'
},
{
loader: 'render-template-loader',
options: {
engine: 'pug',
locals: {
title: 'Rendered with Pug!',
desc: 'Partials Support'
},
engineOptions: function (info) {
return { filename: info.filename }
}
}
}]
}]
},
plugins: []
} It may be because of the module.exports = {
entry: './src/index.js',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [{
test: /\/src\/index.ejs$/,
use: [{
loader: 'render-template-loader',
options: {
engine: 'ejs',
locals: {
title: 'Render Template Loader',
desc: 'Rendering templates with a Webpack loader since 2017'
},
engineOptions: function (info) {
// Ejs wants the template filename for partials rendering.
// (Configuring a "views" option can also be done.)
return { filename: info.filename }
}
}
}]
}]
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.ejs'
})
]
} Perhaps From the documentation on extract-loader:
import stylesheetUrl from "file-loader!extract-loader!css-loader!main.css";
// stylesheetUrl will now be the hashed url to the final stylesheet
I'll consider how this might be documented, perhaps in a FAQ. If you would, post the webpack config you're using so I can have a look. |
Yes.
So if you want chain with |
Added a FAQ section in the version |
I try to make it work with
html-loader
but the output should be a plain-text html and not a js with a exported string.Maybe add an option for output mode.
I can't find a loader "string to plain text"
The text was updated successfully, but these errors were encountered: