daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. webpack.config.js
  2. const data = require('./data');
  3.  
  4. const htmlPlugins = data.map(entry => {
  5.   return new HtmlWebpackPlugin({
  6.     filename: entry.name + '.html',
  7.     template: './template.html',
  8.     variableOne: entry.variable
  9.   })
  10. })
  11.  
  12.  
  13. module.exports = {
  14.   ...htmlPlugins
  15. }
  16.  
  17.  
  18. index.html
  19. <div><%= variableOne %></div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top