kentcdodds / es6-todomvc

The vanillajs example converted to es6
https://kcd.im/webpack-workshop-repo
MIT License
351 stars 358 forks source link

generate html from webpack #23

Closed nawrasbaghdadi closed 8 years ago

nawrasbaghdadi commented 8 years ago

I'm trying to generate the HTML through webpack as in CSS and js, but it seems something is missing , this webpack.config :

const {resolve} = require('path');
   const webpackValidator = require('webpack-validator');
const OfflinePlugin = require('offline-plugin');

module.exports = webpackValidator({
  debug: true,
  context: resolve('./scripts'),
  entry: './main.js',
  output: {
    filename: './scripts/bundle.js',
    pathinfo: true,
  },
  // Change eval to source-map for production
  devtool: 'eval',
  module: {
    loaders: [
      {
        test:/\.(jsx|js)$/,
        exclude: /node_modules/,
        loader: 'imports?jQuery=jquery,$=jquery,this=>window'
      },
      {
        test: /\.css$/,
        exclude: /node_modules/,
        loader: "style-loader!css-loader"
      },
      // ASSET LOADER
      { test: /\.(woff|woff2|ttf|eot)$/, loader: 'file' },
       //IMAGE LOADER
      { test: /\.(jpe?g|png|gif|svg)$/i, loader:'file', exclude: /node_modules/ },
      { test: /\.html$/, loader: "html-loader", exclude: /node_modules/ }
    ]
  },
  resolve: {
    extensions: ['', '.js', '.jsx','.css','.jpg']
  },

  plugins: [
    new OfflinePlugin({

      caches: {
        main: [
          '/images/icons/home2.svg',
          '/images/hamburger.svg',
          '/images/logo_grey.svg',
          ':rest:'
        ]
      },
      externals: [
      '/',
        '/images/icons/home2.svg',
        '/images/hamburger.svg',
        '/images/logo_grey.svg',
      ]
    })
  ]
});

any advice?

kentcdodds commented 8 years ago

Hi @nawrasbaghdadi, I'm not sure what issues you're having.

Could you make a Stack Overflow posting with a little more info about what you're trying to do and what's not working. Then feel free to give me a link to the question and I'll try to get to it if I have time.

nawrasbaghdadi commented 8 years ago

@kentcdodds , kindly check this post http://stackoverflow.com/questions/39898461/webpack-laoders-and-imports it may be a big question but it gives me a better idea about a lot of things

kentcdodds commented 8 years ago

Hmmm... Without actually pulling it down myself, I'm not sure what's going on. I'm afraid I don't have time to give it a solid look though :-/

nawrasbaghdadi commented 8 years ago

@kentcdodds , there are couple questions in the StackOverflow post , if you can give it a look I guess you don't have to pull it and it will be quick easy questions for you ,