rjz / es6-client-boilerplate

Starting point for client-side es6 projects
Other
4 stars 1 forks source link

overkill in compiled source file #3

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi. I have seen a lot of webpack solutions, but in yours it seems to be a overkill. Why include all this and not only the normal source code compiled??

/_/ (function(modules) { // webpackBootstrap /**/ // The module cache /**_/ var installedModules = {};

/_/ // The require function /_/ function webpack_require(moduleId) {

/_/ // Check if module is in cache /**/ if(installedModules[moduleId]) /**_/ return installedModules[moduleId].exports;

/_/ // Create a new module (and put it into the cache) /**/ var module = installedModules[moduleId] = { /_/ exports: {}, /**_/ id: moduleId, /**/ loaded: false /**_/ };

/_/ // Execute the module function /_/ modules[moduleId].call(module.exports, module, module.exports, webpack_require);

/_/ // Flag the module as loaded /_/ module.loaded = true;

/_/ // Return the exports of the module /**/ return module.exports; /**_/ }

/_/ // expose the modules object (webpackmodules) // webpack_require.m = modules;

/_/ // expose the module cache /_/ webpack_require.c = installedModules;

/_/ // webpack_publicpath // webpack_require.p = "";

/*_/ // Load entry module and return exports /**/ return webpack_require(0); /_/ }) /******/ /***/ ([

rjz commented 9 years ago

Thanks for reporting! Is this output from a vanilla webpack run or from using npm run build? The webpack.config in the boilerplate favors development over production (e.g., code is not obfuscated by default to make debugging easier), unless running from the build task in package.json.

Also, this project does not include a separate webpack.production.config, which would allow for finer tuning of the build. I'd love to merge a pull request with some sensible defaults, though!

ghost commented 9 years ago

This I got from a vanilla webacl run. If I do npm run build, the whole source code get minfied and can't be read. For production mode etc, there are a few boilerplates you can look at. They are not so feature rich as this one.

rjz commented 9 years ago

Got it; will the minified build meet your needs for now?

Leaving this issue open for future implementation, but (again) happy to merge a PR from anyone interested in contributing.

ghost commented 9 years ago

@rjz A client of mine tried to use this for client side, and I just spoke to him. As far as he can get things to work easy, it should fit his needs. As I wrote in another comment, I put up my own workflow for a bigger project. But if this workflow are working, probably more clients of mine will start to use it.

What do you need to add? It's very easy to just copy&paste some code form other projects to extend your project with the setup you already have here. The way you build this workflow - simple and clean - will let everyone with some skills to extend this easy.