christianalfoni / webpack-bin

A webpack code sandbox
http://www.webpackbin.com
MIT License
710 stars 75 forks source link

Downloading zip #207

Open Andarist opened 7 years ago

Andarist commented 7 years ago

Downloading zip file downloads a template of configs and index files etc + the written code.

The problem is that it cannot be 'just ran' because i.e. entry point file name is not updated in the webpack.config.js.

I could attempt to fix the issue, just needs some guidance for the approach I should use, as I'm not familiar with the codebase.

Also the version I've downloaded didnt have babel-core in its devDependencies (although it should have), but from what I see its fixed in the source code. But was the fix released?

nabiltntn commented 7 years ago

Yes, the downloaded version does not have babel-core as dev dependencies. But no problem with entry point file.

Andarist commented 7 years ago

maybe if your entry point's name matches the default (main.js), i've called mine index.js and it wont work obviously with the downloaded webpack.config.js. Here it is for easy check:

var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var loaders = [];

module.exports = {
  devtool: 'eval-source-map',
  entry: path.resolve('src', 'main.js'),
  output: {
    path: path.resolve('build'),
    filename: '[name].js',
    publicPath: '/'
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve('src', 'index.tpl.html'),
      inject: 'body',
      filename: 'index.html'
    })
  ],
  module: {
    loaders: loaders
  }
};
wmertens commented 7 years ago

2 more things: I also needed to add webpack-merge, and when I make changes the project.zip does not get updated, I always get the same one.