Comments (2)
My html-loader is having issues with mustache. I added an option for images to have hash and also for videos to have hash in my webpack.common.js. The output for the videos and for the images is correct in the /dist folder - the hash is there, but my output code does not have the hash.
Here is my folder structure:
+--js +--scss +--img +--video | index.mustache | about.mustache | work.mustache
And my webpack.common.js configuration:
const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const currentTask = process.env.npm_lifecycle_event; const VueLoaderPlugin = require('vue-loader/lib/plugin'); module.exports = { entry: { main: './src/js/home.js', about: './src/js/about.js', work: './src/js/work.js', }, module:{ rules: [ //rule for JS { test: /\.js$/, exclude: /(node_modules)/, use:'babel-loader' }, //rule for html { test: /\.html$/i, loader: 'html-loader', }, //rule for mustache files { test: /\.mustache$/, loader: 'mustache-loader', options: { tiny: true, render: { title: 'hello Index', subtitle: 'this is a subtitle', }, }, } , //Vue loader { test: /\.vue$/, use: 'vue-loader' }, //rule for img { test: /\.(png|svg|gif|jpg)$/, use: [ { loader: 'file-loader', options: { name: "[name].[hash].[ext]", outputPath: "img/", publicPath: './img/' } }, ], }, // // rule for pdf files { test: /\.(pdf)$/, use: { loader: 'file-loader', options:{ name: '[name].[ext]', outputPath: "files/", publicPath: './files/' } }, }, // // Assets Loader { test: /\.(mp4|mov|avi|wmv|webm)$/, use: { loader: 'file-loader', options:{ name: '[name].[hash].[ext]', outputPath: "video/", publicPath: './video/' } }, }, // Font Loader { test: /\.(woff|woff2|svg)$/, exclude: [path.resolve(__dirname, './src/img/')], use: { loader: 'file-loader', options:{ name: '[name].[ext]', limit: 4096, mimetype: "application/font-woff", outputPath: 'css/fonts/', publicPath: './css/fonts/', } }, } ], }, plugins:[ new VueLoaderPlugin(), new HtmlWebpackPlugin({ filename: './index.html', template: './src/index.mustache', inject: 'body', chunks: ['main'], }), new HtmlWebpackPlugin({ filename: './about.html', template: './src/about.mustache', inject: 'body', chunks: ['about'], }), new HtmlWebpackPlugin({ filename: './work.html', template: './src/work.mustache', inject: 'body', chunks: ['work'] }), ], resolve: { alias: { '@scss': path.resolve(__dirname, 'src/scss'), '@img': path.resolve(__dirname, 'src/img'), '@': path.resolve(__dirname, 'src') } } }
I don't want to remove the hashes from the images and videos, so I wonder what else can I do. Thank you!
from mustache.github.com.
This looks like a support request for mustache-loader. If still relevant and you have not already done so, please take it to https://github.com/deepsweet/mustache-loader/issues.
from mustache.github.com.
Related Issues (20)
- another implementation in Erlang
- multi-line yaml input to mustache template outputs as JSON HOT 3
- Make current index available for lists HOT 2
- How to escape a partial's output? HOT 2
- Mustache-ES6 HOT 1
- time complexity of mustache HOT 1
- Help with sections HOT 3
- use value from list based on another key HOT 1
- Appending random string starting with 'm_-' to classes after rendering the template HOT 1
- C#/ Net Standard implementation HOT 1
- Mustache substitution minimum string length HOT 1
- Not able to generate template for the Map<String, Map<String, List<Map<String, String>>>>
- Context name from list HOT 9
- Pass variables to different template/entries HOT 1
- Mustache need a standard helper-library? HOT 3
- {{#item.0}} checks HOT 1
- Add line numbers. HOT 2
- How to output raw moustache in a code block? HOT 2
- This repository is about the website only (click here to see where to take your comments)
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 mustache.github.com.